Cognizant interview question

Asked to code basic programs