Kaar Technologies interview question

paper code on c,java output must without errors