BidVertiser

Thursday, May 3, 2012

/*Program in C++ to check if given word is a palindrome or not*/
#include<iostream.h>
#include<conio.h>
#include<string.h>
void main()
{
char str[100],str1[100];
clrscr();
cout<<endl<<"Enter the word:";
cin.get(str,100);
cout<<endl<<"The given string is:"<<str;
strcpy(str1,str);
strrev(str);
if(strcmp(str,str1)==0)
 cout<<endl<<"This word is a palindrome!!!!!";
else
 cout<<endl<<"This word is not a palindrome.";
getch();
}

No comments:

Post a Comment