NTT DATA interview question

Few Puzzles, basic c programs