Skip to content

Commit 9843ee2

Browse files
Merge pull request #158 from chhavi200/patch-1
Palindrome Number
2 parents a3de0a9 + 488abd2 commit 9843ee2

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

Palindrome Number

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import java.util.Scanner;
2+
class PalinRun
3+
{
4+
public static void main(String ar[])
5+
{
6+
int num,rev=0,rem,n;
7+
Scanner s=new Scanner(System.in);
8+
System.out.println("enter no");
9+
num=s.nextInt();
10+
n=num;
11+
do
12+
{
13+
rem=num%10;
14+
rev=rev*10+rem;
15+
num=num/10;
16+
}
17+
while(num>0);
18+
if(n==rev)
19+
System.out.println("no is palindrome");
20+
else
21+
System.out.println("no is not a palindrome ");
22+
}
23+
}

0 commit comments

Comments
 (0)