Infosys interview question

Programming