Saturday, 14 January 2012

Program To Check Number is Palindrome or Not In C++

#include<iostream.h>
#include<conio.h>
main()
{
clrscr();
int a,b,c,d,e,f;
cout<<"Enter number=";
cin>>a;
b=a/10;
c=a%10;
d=b/10;
e=b%10;
f=c*100+e*10+d*1;
if(f==a)
 {
 cout<<"\n palindrom";
 }
else
 {
 cout<<"\n not palindrom";
 }
 getch();
 }

-----

No comments:

Post a Comment