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 does the following do: for(;;) ; a) Illegal b) Loops forever c) Ignored by compiler...not illegal
Define virtual constructor.
What is the purpose of templates in c++?
What is a modifier in c++?
What is #include sstream?
What is the basic structure of c++ program?
Write a program in c++ to print the numbers from n to n2 except 5 and its multiples
Explain about templates of C++.
Can the operator == be overloaded for comparing two arrays consisting of characters by using string comparison?
Of the numbers 12 23 9 28 which would be at the top of a properly implemented maxheap a) 28 b) 9 c) Any of them could be
What are the various arithmetic operators in c++?
Is c++ the best programming language?
What are features of c++?
What are punctuators in c++?
What is the difference between global variables and local variable