Given an integer N, write a program that returns true if the given number is a palindrome, else return false.
Input: N = 2002 Output: true Input: N = 1234 Output: false
A simple method for this problem is to first reverse digits of n, then compare the reverse of n with n. If both are same, then return true, else false.
Below is the implementation of the above approach:
Is 4562 a Palindrome number? -> false Is 2002 a Palindrome number? -> true
- Bash program to check if the Number is a Palindrome
- Recursive program to check if number is palindrome or not
- Program to check if an Array is Palindrome or not using STL in C++
- Program to check if an Array is Palindrome or not
- C Program to Check if a Given String is Palindrome
- Program to check if an array is palindrome or not using Recursion
- Java program to check whether a string is a Palindrome
- Python program to check if given string is vowel Palindrome
- Java program to check palindrome (using library methods)
- TCP Client-Server Program to Check if a Given String is Palindrome
- Check if a number is Palindrome
- Check if a number is Palindrome in PL/SQL
- Check if number is palindrome or not in Octal
- To check a number is palindrome or not without using any extra space
- Generate number with given operation and check if it is palindrome
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.