Program
import java.util.Scanner;
class Demo1{
public static void main(String args[]){
int r,sum=0,temp,n;
Scanner s=new Scanner(System.in);
System.out.println("Enter n Value: ");
n=s.nextInt();
temp=n;
while(n>0){
r=n%10;
sum=(sum*10)+r;
n=n/10;
}
if(temp==sum)
System.out.println("palindrome number ");
else
System.out.println("not palindrome");
}
}
Output:
Enter n Value : 121
palindrome number
Enter n Value : 1224
not palindrome
For latest job updates join Telegram Channel: https://t.me/sateeshm