#include <iostream>
int main()
{
int n,m,p,q;
cout <<"Enter the number\n";
cin >>n;
cout << "Entered number is \n"<<n;
m=n;
p=0;
do
{
q=n%10;
n=n/10;
p=p*10+q;
} while(n!=0);
if(p==m)
cout <<"The given number is palindrome \n"<<m;
else
cout <<"The given number is not palindrome \n"<<m;
return 0;
}
int main()
{
int n,m,p,q;
cout <<"Enter the number\n";
cin >>n;
cout << "Entered number is \n"<<n;
m=n;
p=0;
do
{
q=n%10;
n=n/10;
p=p*10+q;
} while(n!=0);
if(p==m)
cout <<"The given number is palindrome \n"<<m;
else
cout <<"The given number is not palindrome \n"<<m;
return 0;
}
No comments:
Post a Comment