Palindrome NO

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Palindrome NO.

Program

# include <iostream>

using namespace std;

int main()

int num;

int rev=0;

int a;

cout<<"please enter the num"<<endl;

cin>>num;

int x=num;

while(num>0)

a=num%10;

rev=rev*10+a;

num=num/10;

if(x==rev)

cout<<"the num is palindrome"<<endl;

else

cout<<"not palindrome"<<endl;

}
system("pause");

return 0;

You might also like