MCPcopy Create free account
hub / github.com/PrajaktaSathe/Java / main

Method main

palindrome.java:4–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2class palindrome
3{
4 public static void main()
5 {
6 Scanner sc= new Scanner(System.in);
7 System.out.println("enter a number");
8 int num= sc.nextInt();
9 int d,num1,rev;rev=0;
10 num1=num;
11 while(num!=0)
12 {
13 d=num%10;
14 rev=rev*10+d;
15 num=num/10;
16 }
17 if(num1==rev)
18 System.out.println("the number is palindromic");
19 else
20 System.out.println("the number is not palindromic");
21}
22}
23
24

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected