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
What is struct c++?
What is a dangling pointer in c++?
What are shallow and deep copies?
Can comments be longer than one line?
What do you mean by translation unit?
Do class declarations end with a semicolon? Do class method definitions?
What is the difference between containment and delegation?
Declare a class vehicle and make it an abstract data type.
How can I learn c++ easily?
What is lambda in c++?
What is the full form of stl in c++?
Can create new c++ operators?
Why c++ does not have finally?
Can we inherit constructor in c++?
What is auto type c++?