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

Method main

Programs/Palindrome.java:11–30  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

9public class Palindrome {
10
11 public static void main(String[] args)
12 {
13 Scanner sc=new Scanner(System.in);
14 int n=sc.nextInt();
15 int copy=n;
16 int r=0,d=0;
17 while(n>0)
18 {
19 d=n%10;
20 r=10*r+d;
21 n=n/10;
22 }
23 if(r==copy)
24 {
25 System.out.println(copy+" is a palindrome number");
26 }
27 else{
28 System.out.println(copy+" is not a palindrome number");
29 }
30 }
31
32}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected