Cognizant interview question

basic programming