Cognizant Interview Question

Based on basic programming