HCLTech interview question

simple programming