C++ Program to check input number is Palindrome or not

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int r,x=0,temp;
int y;
cout<<"Enter Number:- ";
cin>>y;
temp=y;
while(y>0)
{
  r=y%10;
  x=(x*10)+r;
  y=y/10;

}
if(temp==x)
 {
  cout<<"Number is palindrome";
 }
 else
 {
  cout<<"Number is not palindrome";
 }
 getch();
}

OUTPUT:-

Leave a Reply

Your email address will not be published. Required fields are marked *