Showing posts with label Reverse the digits. Show all posts
Showing posts with label Reverse the digits. Show all posts

Thursday, July 7, 2011

Program to Reverse the digits of any integer number

class ReverseDigits
{
public static void main(String args[])
{
int num , temp ; 
num = 1234;
System.out.println(" The Number is : "+num);

System.out.print(" The Reverse Number is : ");
do
{
temp = num % 10 ;
System.out.print(temp);
num = num / 10 ;
}
while (num != 0) ;



}
}