Infosys interview question

Logical Questions based in Programming