class Pallindrome
{
public static void main(String args[])
{
int num=131;
int r,temp,sum=0;
temp=num;
while(num!=0)
{
r=num%10;
num=num/10;
sum=sum*10+r;
}
if(sum==temp)
System.out.println("no. is pallindrome");
else
System.out.println("no. is not pallindrome");
}
}
{
public static void main(String args[])
{
int num=131;
int r,temp,sum=0;
temp=num;
while(num!=0)
{
r=num%10;
num=num/10;
sum=sum*10+r;
}
if(sum==temp)
System.out.println("no. is pallindrome");
else
System.out.println("no. is not pallindrome");
}
}
No comments:
Post a Comment