Infosys Interview Question

They asked me one simple code.