mirror of
https://github.com/c0de-archive/hacktoberfest-2018.git
synced 2024-11-01 04:07:48 +00:00
23 lines
372 B
C++
23 lines
372 B
C++
#include <iostream>
|
|
|
|
using namespace std;
|
|
|
|
int main()
|
|
{
|
|
long a,rev,b;
|
|
cout<<"\nenter the number :";
|
|
cin>>a;
|
|
b=a;
|
|
rev=0;
|
|
while(b)
|
|
{
|
|
rev=(rev*10)+(b%10);
|
|
b=b/10;
|
|
}
|
|
if(a==rev)
|
|
cout<<"\n the number IS a palindrome.";
|
|
else
|
|
cout<<"\n the number IS NOT a palindrome.";
|
|
return 0;
|
|
}
|