class Palindrome
{
public static void main(String args[]){
int r,sum=0,temp;
int n=454; // Input no palindrome
temp=n;
while(n>0) // check conditions
{
r=n%10; //getting remainder
sum=(sum*10)+r;
n=n/10;
}
if(temp==sum)
System.out.println("palindrome number ");
else
System.out.println("not palindrome");
}
}
No comments:
Post a Comment