Wednesday 12 September 2012

Palindrom

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int x,a,b,c,d,e,f,g,h;
cout<<"Enter the 5 digit integer=";
cin>>x;
a=x/10000;
b=x%10000;
c=b/1000;
d=b%1000;
e=d/100;
f=d%100;
g=f/10;
h=f%10;
if(a==h&&c==g)
cout<<"the number is palindrome";
else
cout<<"not a palindrome";
getch();
}

No comments:

Post a Comment