Wipro Interview Question

Basic C programming and some logical puzzles