Cognizant interview question

basic coding questions related to numerical problems