Infosys Interview Question

To write some simple codes