C please ignore the use your code in question 3 Use your co

C++ please ( ignore the use your code in question 3).

Use your code in question 3 to determine if user\'s input (integer number) is palindrome or not. For example, if the input is 12321 then this number if palindrome. Also, 1221 is palindrome, but not 12324. Write a function for your implementation.

Solution

Program to check a number is palandrom or not

#include<iostream>
using namespace std;

void palan(int n)
{
   int n1,d,rn=0;
   n1=n;
   while(n>0)
   {
       d=n%10;
       rn=(rn*10)+d;
       n/=10;
   }
   if(n1==rn)
   cout<<n1<<\" is a palindrome number\"<<endl;
   else
   cout<<n1<<\" is not a palindrome number\"<<endl;

}

int main()
{
    unsigned long n,num,d,rev=0;
    cout<<\"Enter any number: \";
    cin>>n;
    palan(n);

}

C++ please ( ignore the use your code in question 3). Use your code in question 3 to determine if user\'s input (integer number) is palindrome or not. For examp

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site