Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Palindrome Number in Java
//'main' method must be in a class 'Rextester'. //openjdk version '11.0.5' import java.util.*; import java.lang.*; class Rextester { public static void main(String args[]) { int n = new Scanner(System.in).nextInt(); int rev = 0, x = n; while(x > 0) { rev = rev * 10 + (x % 10); x /= 10; } if(rev == n) System.out.println("Palindrome Number."); else System.out.println("Not a Palindrome Number."); } } // PROGRAM BY 'JAMES COLLINS'
run
|
edit
|
history
|
help
0
Combination Sum (Leetcode)
Stack implementation
Test processing time (loop vs. contains)
Count and Say
Multiples of 3 and 5
stringkeyvalues
Filter Iterator
has a
forloop
arithematic