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 polymorphism and its type in c++?
What is data type in c++?
the first character in the variable name must be an a) special symbol b) number c) alphabet
Will the following program execute?
Where is atoi defined?
Can static member variables be private?
Why is c++ called oops?
What are built-in functions? What is the syntax for the definition?
What is buffer and example?
What is a block in c++?
What is prototype for that c string function?
What is the difference between C and CPP?
what Is DCS ? what i will get benefit when i did?
What is static function? Explain with an example
What is private public protected in c++?