Cognizant interview question

Basic programming questions which were easy