// PALINDROME Number Checking Program Using Class
#include <iostream>
using namespace std;
class pali
{
int n,t,rem,sum=0;
public:
void getdata();
void check();
};
void pali::getdata()
{
cout<<"\n PALINDROME Number Checking Program;"<<endl;
cout<<"\n Enter a Number : ";
cin>>n;
cout<<n<<endl;
}
void pali:: check()
{
t=n;
while(t!=0)
{
rem=t%10;
sum=sum*10+rem;
t=t/10;
}
if(sum==n)
{
cout<<"\n Given Number "<<n<<", is a PALINDROME Number."<<endl;
}
else
{
cout<<"\n Given Number "<<n<<", is not a PALINDROME Number."<<endl;
}
}
int main()
{
pali n;
n.getdata();
n.check();
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: