C++ Program to Check Whether a Number is Palindrome or Not

C++ Program to Check Whether a Number is Palindrome or Not.Hi,Today we make a program About How To find that the given number is palindrome or not.we Get vaule for User it Number is Palindrome or not.Now We Will check it.

C++ Program to Check Whether a Number is Palindrome or Not

#include<iostream>
#include<conio.h>
using namespace std;
main()
{
int number,a,b,c,d,e,f,g,h,mango;
cout<<"Ente the five digit number:";
cin>>number;
cout<<endl;
mango=number/10000;
a=number%10000;
b=a/1000;
c=a%1000;
d=c/100;
e=c%100;
f=e/10;
g=e%10;
cout<<mango<<b<<d<<f<<g<<endl;
if(mango==g && b==f)
cout<<"Number is Palindrom";
else
cout<<"Number is not a Palindrom";
getch();
}

Output of Program

Enter a positive number: 12321
The reverse of the number is: 12321
The number is a palindrome.

Enter a positive number: 12331
The reverse of the number is: 13321
The number is not a palindrome.

Enter the number: 121
Reversed number: 121

121 is a palindrome number.

Enter the number: 1231
Reversed number: 1321

1231 is not a palindrome number.