Code Below:


import java.util.*;
class pal
{
    public static void main()
    {
        Scanner s= new Scanner(System.in);
        int n,a,dup,rev=0;
        System.out.println("Enter a no.");
        n=s.nextInt();
        dup=n;
        while (n>0)
        {
            a=n%10;
            rev=rev*10+a;
            n=n/10;
        }
        if(rev == dup)
        System.out.println("NO. IS PALINDROME");
        else
        System.out.println("NO. IS NOT PALINDROME");
    }
}