#include <iostream>
using namespace std;
class palindrome
{
int a,b,c,d;
public:
void get();
void check();
};
void palindrome::get()
{
cout<<"Enter a number:"<<endl;
cin>>a;
}
void palindrome::check()
{
b=a;
c=0;
while(a>0)
{
d=a%10;
c=c*10+d;
a=a/10;
}
if(c==b)
cout<<b<<" is a Palindrome"<<endl;
else
cout<<b<<" is not a Palindrome"<<endl;
}
int main()
{
palindrome p;
cout<<"CHECKING PLAINDROME OR NOT:"<<endl;
p.get();
p.check();
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: