
// Program to find whether a given number is palindrome or not
If not make it palindrome by adding to its end
#include <iostream.h>
int main(void)
{
     long n,i,j,sum=0;
     cout<<"Enter any number \n";
     cin>>n;
     j=n;
     while(j)
     {
          sum =sum*10+j%10;
          j /=10;
     }
     if(sum==n)
     cout<<"\n palindrome";
     else
     {
          i=n;
          n/=10;
          while(n)
          {
               i= i*10+n%10;
               n /=10;
          }
          cout<<"\n new palindrome"<<i;
     }
     return 0;
}
Test data 1
Enter any number
121
Output
palindrome
Test data 2
Enter any number
123
Output
new palindrome 12321