 # C++ Programming Code Examples

## C++ > Mathematics Code Examples

### Find Palindrome number in c++

``` Find Palindrome number in c++ What is a palindrome number? If the digits of a numbers reversed and number remain the same then it is called palindrome number For example: Digits from 0 to 9 are palindrome numbers and 22 ,33, 44, 121, 12321, 131 etc.. for more information click here palindrome number concept by Wikipedia Simple c++ code to find number is palindrome or not: We already known that if reverse of a number is equal to the same number than it is palindrome number Keeping in mind this certain variables and a loop use to get the reverse of a number which stores in variable 'reverse' After that using if else we check if reverse is equal to original number than it is a palindrome number otherwise it is not a palindrome number #include<iostream> using namespace std; int main() { int palindrome, reverse=0; cout<<"Enter number: "; cin>>palindrome; int num=0,key=palindrome; for(int i=1;palindrome!=0;i++){ num=palindrome%10; palindrome=palindrome/10; reverse=num+(reverse*10); } if(reverse==key){ cout<<key<<" is a Palindrome Number"; } else{ cout<<key<<"is NOT a Palindrome Number"; } return 0; } ``` 