#include<iostream.h>
#include<conio.h>
void palindrome(int a);
void main()
{
clrscr();
int a;
cout<<"enter a no.";
cin>>a;
palindrome(a);
getch();
}
void palindrome(int a)
{
int r,b=0,f=100,on=a;
while(a>0)
{
r=a%10;
a=a/10;
b=b+(r*f);
f=f/10;
}
if(on==b)
{
cout<<"palindrome";
}
else
{
cout<<"not a palindrome";
}
}
#include<conio.h>
void palindrome(int a);
void main()
{
clrscr();
int a;
cout<<"enter a no.";
cin>>a;
palindrome(a);
getch();
}
void palindrome(int a)
{
int r,b=0,f=100,on=a;
while(a>0)
{
r=a%10;
a=a/10;
b=b+(r*f);
f=f/10;
}
if(on==b)
{
cout<<"palindrome";
}
else
{
cout<<"not a palindrome";
}
}