WAP to check for plaindrome numbers
Answers
Answered by
0
Answer:
palindrome number is one that remains the same on reversal. Some examples are 8, 121, 212, 12321, -454. To check if a number is a palindrome or not, we reverse it and compare it with the original number, if both are the same, it's a palindrome otherwise not. C palindrome string program.
Answered by
34
Here is your answer.
class x
{
static void main(int n)
{
int m=n, s=0;
while(n!=0)
{
s=s*10+n%10;
n/=10;
}
if(s==m)
System.out.println("Palindrome.");
else
System.out.println("Not Palindrome.");
}
}
Similar questions