We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c2e01ee commit c373383Copy full SHA for c373383
1 file changed
palindrome-checker.java
@@ -0,0 +1,24 @@
1
+import java.util.Scanner;
2
+class PalindromeExample
3
+{
4
+ public static void main(String args[])
5
+ {
6
+ int r,sum=0,temp;
7
+ int n;
8
+
9
+ Scanner sc = new Scanner(System.in);
10
+ System.out.println("Enter the number:");
11
+ n = sc.nextInt();
12
+ temp=n;
13
+ while(n>0)
14
15
+ r=n%10;
16
+ sum=(sum*10)+r;
17
+ n=n/10;
18
+ }
19
+ if(temp==sum)
20
+ System.out.println("palindrome number ");
21
+ else
22
+ System.out.println("not palindrome");
23
24
+}
0 commit comments