// Write a program to check whether a given string is a palindrome or not
#include<iostream.h>
#include<conio.h>
#include<string.h>
void main()
{
char s[100],r[100];
clrscr();
cout<<"Enter the string: ";
cin.getline(s,100);
strcpy(r,s);
strrev(r);
if(strcmpi(s,r)==0)
cout<<"It is palindrome";
else
cout<<"It is not
palindrome";
getch();
}

No comments: