Palindrome Number

#include <iostream.h>
#include <conio.h>
void main(){
   clrscr();
   int a,n,b,temp=0;
   cout<<"enter any number:"; 
   cin>>n;
   b=n;
   while(n>0){
      a=n%10;
      n=n/10;
      temp=temp*10+a;
   } 
   if(temp==b){
      cout<<"it is a palindrome number";
   }else{
      cout<<"it is not palindrome number";
   }
   getch();
}

Output

Palindrome
Palindrome
(Visited 132 times, 1 visits today)
Share with Friends :