write program for palindrome

Answer Posted / pallavi attarde

#include<iostream.h>
#include<string.h>

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

gets(str);

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

cout<<endl;

Is This Answer Correct ?    596 Yes 248 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is else if syntax?

684


Which compiler does turbo c++ use?

610


What are signs of manipulation?

599


Do you know what are pure virtual functions?

644


Can we declare a base-class destructor as virtual?

588






What is object in c++ wikipedia?

575


What is the difference between #import and #include?

555


Describe new operator?

626


What's the hardest coding language?

579


Describe the syntax of single inheritance in C++?

651


Is multimap sorted c++?

562


Do the names of parameters have to agree in the prototype, definition, and call to the function?

606


Explain the difference between struct and class in terms of access modifier.

699


How many characters are recognized by ANSI C++?

901


Explain the use of virtual destructor?

632