Learning  C++
Home
Tutorials
C++  Programs
Contact  us
Sitemap
Your Ad Here
Your Ad Here
// Program to check whether the given string is palindrome or not
  using library functions

#include<iostream.h>
#include<string.h>
int main()
{
     char str[80],temp[80];
     cout<<"Enter string to check \n";
     cin>>str;
     strcpy(temp,str);
     strrev(temp);
     if(strcmp(str,temp)==0)
          cout<<"\n Given string is palindrome";
     else
          cout<<"\n Given string is not palindrome";
     return 0;
}



Test data 1

Enter string to check
madam

Output
Given string is palindrome


Test data 2

Enter string to check
master

Output
Given string is not palindrome