Cognizant Interview Question

some basic programming and logical questions