# Check Palindrome Number

“** Check Palindrome Number**” is very basic and important programming exercise problem. Here, we are given an integer, entered by user and our task is to write a program to check whether an entered number is palindromic number or not.

*A palindromic number is a number which is when reversed stays the same number.*

Examples of Palindromic Number are **22, 212, 33433** etc.

The steps required to check whether a number is palindrome or not are as follows:

- Scan a number from a user and copy that number to temporary variable.
- Initialize a reverse_number with 0.
- Now, one by one fetch out the last digit from a number using modulus operator and concatenate to reverse_number.
- Now, check whether reversed_number and temporary variable number are same or not.
- If they are same, then given number is palindromic number. Else, given number is not palindromic number.

**C++ Program to check whether an integer is palindrome or not is as follows:**

#include<bits/stdc++.h> using namespace std; int main() { //Scan the number int num; cout<<"Enter the number:"; cin>>num; // Reverse the number int temp = num; int reverse = 0; while(temp > 0) { int digit = temp % 10; reverse = reverse*10 + digit; temp = temp/10; } // Check Palindrome number if(num == reverse) cout<<num<<" is Palindromic Number"; else cout<<num<<" is not Palindromic Number"; }

Enter the number:7117 7117 is Palindromic NumberOUTPUT: