Infosys interview question

To write the basic programs