Write a function that checks whether an input number is a palindrome or not.
[Note: A number or a string is called palindrome if it appears same when written in reverse order also. For
example, 12321 is a palindrome while 123421 is not a palindrome]
Answers
Answered by
1
Answer:
public class abc {
public static void main (int n){
int k=n, b,r;
while (n>0)
{
b=n%10;
r=r*10+b;
n=n/10;
}
if (r==k)
System.out.println ("Palindrome Number");
else
System.out.println ("Not a palindrome number");
}
}
And it's done!!!
Hope it successfully helps you out...
Please mark me as the brainliest...
Similar questions
Geography,
5 months ago
Computer Science,
5 months ago
English,
5 months ago
Computer Science,
10 months ago
Computer Science,
10 months ago
Environmental Sciences,
1 year ago