write program for palindrome
Answer Posted / neha
char a[20],b[20];
printf("enter a string");
scanf("%s",&a);
strcpy(b,a);//copies string a to b
strrev(b);//reverses string b
if(strcmp(a,b)==0)//compares if the original and reverse
strings are same
printf("\n%s is a palindrome",a);
else
printf("\n%s is not a palindrome",a);
return 0;
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is c++ map?
Which header file allows file i/o with streams a) fileio.h b) iostream.h c) fstream.h
What is stl containers in c++?
What are the stages in the development cycle?
Define anonymous class.
Is there a c++ certification?
Explain the pure virtual functions?
What do you mean by persistent and non persistent objects?
What is constant in c++ with example?
Why is c++ awesome?
When there is a global variable and local variable with the same name, how will you access the global variable?
What is the main use of c++?
Which programming language's unsatisfactory performance led to the discovery of c++?
Write about the role of c++ in the tradeoff of safety vs. Usability?
find the two largest values among the 6 numbers using control structures : do-while,for,if else,nestedif- else ,while. one or two of them.