Java Program to Check Palindrome Number in Java
import java.util.Scanner;
public class PalindromeNumber {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("Enter an integer number: ");
int original = sc.nextInt();
int reversed = 0;
int temp = original;
while (temp != 0) {
int digit = temp % 10; // get last digit
reversed = reversed * 10 + digit; // build reversed number
temp = temp / 10; // remove last digit
}
if (original == reversed) {
System.out.println(original + " is a Palindrome number");
} else {
System.out.println(original + " is not a Palindrome number");
}
sc.close();
}
}
Very informative and well-written article! The explanation provided here is clear and easy to understand for learners at all levels. Those who are looking to gain practical experience and job-ready skills can explore the No 1 Java Real Time Projects Online Training in Hyderabad, which offers hands-on learning with real-time projects. Thank you for sharing such useful and valuable information!
ReplyDeleteThis is a very informative discussion about scalable system architecture. Developers who learn both Java programming and system design concepts can build more efficient and reliable applications. You can also explore Top System Design with Java Online Training in Hyderabad to understand real-world software architecture.
ReplyDeleteThis is a very helpful article for beginners who want to build a strong foundation in Java. Understanding core concepts is essential before moving to advanced topics. Learners can explore Core JAVA Online Training to gain solid knowledge and improve their programming skills.
ReplyDelete