- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprint.java
More file actions
Latest commit
23 lines (23 loc) · 612 Bytes
/
Copy pathprint.java
File metadata and controls
23 lines (23 loc) · 612 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
importjava.util.Scanner;
publicclassprintextendsqwertyuiop
{
publicstaticvoidpalindrome()
{
clear();
System.out.println("\u000C");
Scannersc=newScanner(System.in);
System.out.println("Enter a number to check if it is a palindrome: ");
inta=sc.nextInt();
intb=a,c=0,d=0;
while(b!=0)
{
c=b%10;
b=b/10;
d=d*10+c;
}
if(d==a)
System.out.println("PALINDROME");
else
System.out.println("NOT PALINDROME");
}
}