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 are enumerations?
What is the use of endl in c++ give an example?
What do you mean by global variables?
What is the difference between a declaration and a definition?
How do you remove an element from a set in c++?
What is a hashmap c++?
What is main function in c++ with example?
What is the outcome of cout< a) 16 b) 17 c) 16.5
What is the need of a destructor?
Why is c++ still best?
Difference between pointer to constant and constant pointer to a constant. Give example.
When should we use multiple inheritance?
What are the defining traits of an object-oriented language?
Which one is better- macro or function?
Is c++ a good first language to learn?