palindrome

#include<iostream.h>
#include<conio.h>
#include<stdio.h>
void main()
{
clrscr();
char a;
do{
int i,j,rev=0;
long int x;
cout<<“\nEnter the number :”;
cin>>x;
i=x;
for(;i>0;)
{
j=i%10;
rev=(rev*10)+j;
i=i/10;
}
cout<<“\n”<<rev;
if(rev==x)
{
cout<<“\nNumber is palindrome “;
}
else
{
cout<<“\nNumber is not palindrome”;
}
cout<<“\n \nTo check again enter (y/Y)”;
cin>>a;
}while(a==’y’||a==’Y’);

}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s