How to find Palidrom

import java.io.*;
class pallidrom
{
public static void main(String args[])
{
int a,b,n,sum=0;
Console con = System.console();
n = Integer.parseInt(con.readLine());
b=n;
while(n!=0)
{
a=n%10;
sum = sum*10+a;
n=n/10;
}
if(b== sum)
System.out.print(b+"Number is pallidrom");
else
System.out.print(sum+"Number is not pallidrom");
}
}

Comments