How to reverse a number in java?
class Reverse
{
public static void main(String args[])
{
int num=564;
int reverse =0;
while( num != 0 )
{
reverse = reverse * 10;
reverse = reverse + num%10;
num = num/10;
}
System.out.println(""Reverse is: ""+reverse);
}
}