Pregunta de entrevista de Infosys

Please explain the below code why it is not working