using namespace std;
main()
{
string s,rev=""; int i, len;
cout<<"Enter a Word\n";
cin>>s;
len=s.length()-1;
for(i=len;i>=0;i--)
{
rev=rev+s.at(i);
}
if(rev==s)
cout<<s<<" is a Palindrome Word";
else
cout<<s<<" is not a Palindrome Word";
}
No comments:
Post a Comment