
Palindrome Test
I am trying to write a program that repeatedly prompts a user for a positive integer number and tests whether the number is a palindrome. The program should convert the integer value given by the user into its reverse number. It should then check to see whether the reverse number equals to the original number.
How can i do this?

It is quite easy to reverse a non negative number though:
Code:
public int reverse(int n) {
int r;
for (r= 0; n != 0; n/= 10)
r= 10*r+n%10;
return r;
}
A number n is a palindrome if:
n == reverse(n)