Reverse A Number

int num=578;
int reversenum =0;
System.out.println(“Input your number and press enter: “);
while( num != 0 )
{
reversenum = reversenum * 10;
reversenum = reversenum + num%10;
num = num/10;
}

System.out.println(“Reverse of input number is: “+reversenum);