Reversal problem for beginner

I tried to compiler the programme worked it worked but it is showing wrong ans plz help
(CodeChef: Practical coding for everyone)

Hey, you only need to print the number as shown in the sample output.

System.out.println(sum);