A palindromic number (also known as a numeral palindrome or a numeric palindrome) is a number (such as 16461) that remains the same when its digits are reversed.
Output :
C++ program to check weather the number is palindrome or not.
#include <iostream>
using namespace std;
int main()
{
int n,r,sum=0,rev=0;
cout<<"Enter Number : ";
cin>>n;
rev=n;
while(n!=0)
{
r=n%10;
sum=sum*10+r;
n/=10;
}
if(sum==rev)
cout<<rev<<" is Pelimdron Number";
else
cout<<rev<<" is Not a Pelimdron Number";
return 0;
}
No comments:
Post a Comment