#include<iostream.h> #include<conio.h> void main() { clrscr(); int a,b,c=0,temp; cout<<"enter the number : "; cin>>a; temp=a; while(temp>0) { b=temp%10; temp=temp/10; c=c*10+b; } if(a==c) cout<<"palindrome"; else cout<<"not palindrome"; getch(); }
For Further Reading,
0 comments:
Post a Comment