Wipro interview question

Basic C programming and some logical puzzles