Find The Palindrome Number Using C++
========================================================================
{
int n, reverse = 0, temp;
cout<<"Enter a number to check if it is a palindrome or not\n";
cin>>n;
temp = n;
while( temp != 0 )
{
reverse=reverse * 10;
reverse=reverse + temp%10;
temp=temp/10;
}
if ( n==reverse )
cout<<n<<"is a palindrome Number";
else
cout<<n<<"is a not palindrome Number";
}
========================================================================
0 comments:
Post a Comment