Code is copied!
Program To Print Palindrome Number JAVA
Write a Program to print whether the inputted number is Palindrome or not.
[A palindrome number is a number that is same after reverse. For example 545, 151, 34543, 343, 171, 48984 are the palindrome numbers]
import java.util.*; class palindrome { public static void main(String args[]) { Scanner sc = new Scanner (System.in); int n = sc.nextInt(); int rev=0,temp = n; while (n>0) { int digit = n % 10; rev = rev * 10 + digit; n=n/10; } if(temp == rev) { System.out.println("yes it is palindrome number"); } else { System.out.println("No it is not palindrome"); } } }