Infosys interview question

Basic programming knowledge.