How to Use Reverse number in java

Reverse means, a complete change of direction or action and place.

//code for reverse number

class Demo
{
int rem, rev =0;
x = 135;
for( ; x>0; )
{
rem = x % 10;
rev = (rev * 10)+ rem;
x=x/10;
}
System.out.println(rev);
}

happy codding..

Tags: ,