// A Source code of C++ program to check the Name or String is a Palindrome or not.
#include<iostream.h> // to use cin>> and cout<< as input and output
#include<stdlib.h> //to include the function itoa() which convert an integer to string
#include<conio.h> //to use the functions clrscr() and getch() written inside
#include<string.h> //to use the function named strlen() designed inside it
void main()
{ int num, left, right;
char strnum[10],flag='y';
clrscr();
cout<<"\n Please enter the integer number only"; cin>>num;
itoa(num, strnum, 10);
cout<<strnum;
left=0;
right=strlen(strnum)-1;
while((flag=='y')&&(left<=right))
{
if(strnum[left]==strnum[right])
{left++; right--;}
else
flag='n';
}
if(flag=='n')
cout<<"\n The given number is NOT a Palindrome";
else
cout<<"\n The given number is a Palindrome";
getch();
}