Capgemini Engineering interview question

Technical Rounds - writing C program for analytical problem