Programming Logics FORUMS

Full Version: To find that list is palindrome or not
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Please help me to Write a program that takes a list of characters from user and checks whether the character
list is palindrome or not.
A palindrome is a string that is spelled the same way forwards and backwards.
For Example:
Madam
Civic
Radar
Pop
Code:
#include<iostream.h>
#include<string.h>

int main()
{
     char str[25],str1[25];    
     cout<<"Enter a string: ";
    
     cin>>str;

     strcpy(str1,str);
     strrev(str);
    if(strcmp(str,str1)!=0)
    {
         cout<<"string is not palindrome";
    }
    else
    {
          cout<<"string is a palindrome";
    }

      cout<<endl;
      
      system("pause");
      return 0;
   }
wow .. good one
Thanks Man!!!
it helps a lot
yea ... good one ...
(13-05-2009 09:01 PM)Skidro Wrote: [ -> ]Thanks Man!!!
it helps a lot

no problem ... you are welcome
wow thats really good
Hello Friends.
I read your entire post it is too useful for me because of I'm also a student of computer science so I have knowledge of c and c++ well it is good news for me I got the such type of site and friends and I share my problems.
Reference URL's