Infosys interview question

Basic stuff but it was simple