Earn without any Investment!

Saturday, November 13, 2010

String Palindrome

#include<iostream.h>
#include<conio.h>
#include<string.h>
void main()
{
clrscr();
char s[10],a[10],b[10];
cout<<"enter any string:";
cin>>s;
strcpy(a,s);
strrev(a);
if(strcmp(a,s)==0)
cout<<"\nThe given String is Palindrome";
else
cout<<"\nThe given String is not Palindrome";
getch();
}

No comments:

Post a Comment