Write a program to find whether the entered number is palindrome or not

//This is a program to find whether the entered number is palindrome or not
#include<iostream>
#include<conio.h>

using namespace std;

int main()
{
int rem=0,rev=0,ori,num;

cout<<"\n\nEnter any number: ";
cin>>num;

ori=num;

while(num>0)
{
rem=num%10;
rev=(rev*10)+rem;
num=num/10;
}

if(rev==ori)
cout<<"\n\nThe Entered number is a palindrome number.";
else
cout<<"\n\nThe Entered number is not a palindrome number.";

return 0;

}


Previous
Next Post »