Infosys interview question

They asked me one simple code.