Infosys Interview Question

Please explain the below code why it is not working