Jinson Jacob -3 Newbie Poster
#include<iostream.h>
#include<string.h>
#include<conio.h>
void main()
{
clrscr();
int i,j,len,flag=1;
char a[20];
cout<<"Enter a string : ";
cin>>a;
len= strlen(a);
for(i=0,j=len-1;i<=len/2;i++,j--)

{
if(a[j]!=a[i])
flag=0;
}
if(flag==1)
cout<<"\n The string is palindrome. ";
else
cout<<"\n The string is not palindrome. ";
getch();
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.