#include<iostream>
#include<string.h>
#include<conio.h>
using namespace std;
int main()
{
char str1[100],str2[100];
cout<<"Enter a String:"<<endl;
cin.getline(str1,100);
strcpy(str2,str1);
strrev(str2);
if(strcmp(str1,str2)==0)
{
cout<<"Entered string is Palindrome...\n";
}
else
{
cout<<"Its not a Palindrome...\n";
}
cout<<"\n\n\n\n\t\t\tPress any key to continue\n";
getch();
}
No comments:
Post a Comment