Domanda di colloquio di Infosys

Please explain the below code why it is not working