New course! Every coder should learn Generative AI!
Try a free lesson0
#include <iostream.h>
voidmain( )
{
int n , num , digit , rev=0;
cout <<"\n Input the number (max. 32767):";
cin>>num;
n=num;
do
{
digit=num%10;
rev=(rev*10)+digit ;
num=num/10;
}
while(num!=0) ;
cout <<"The reverse of the numbr is :"<<rev <<"\n";
if(n==rev)
cout <<"\n The number is palindrome";
else
cout <<"\n The number is not palindrome";
}
HOPE this is helpfull
PEACE\/