Cognizant Interview Question

Write a C program for the Digital gate