write a program to input a 2 digit number and check wether it is a palindrome or not
( A number is a Palindrome which when read in reverse order is same as read in the right order )
Answers
Answered by
2
Answer:
import java.util.*;
class ab
{
void main()
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter the number");
int num= sc.nextInt();
int r=num%10;
int rev = r;
r=r/10;
rev= (rev*10)+r;
if(rev==r)
System.out.println("Pallindrome number");
else
System.out.println("Not a Pallindrome number");
}
}
Similar questions
Math,
1 month ago
English,
1 month ago
Accountancy,
1 month ago
English,
3 months ago
Computer Science,
3 months ago
Math,
10 months ago
Biology,
10 months ago