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 low level language in simple words?
Why do we use classes in programming?
List the advantages of inheritance.
Is string an object in c++?
What are keywords in c++?
What is a v-table?
What is the most powerful coding language?
What are the various storage classes in C++?
What is input operator in c++?
What does new return if there is insufficient memory to make your new object?
What do you mean by a template?
Should I learn c or c++ first?
If a round rectangle has straight edges and rounded corners, your roundrect class inherits both from rectangle and from circle, and they in turn both inherit from shape, how many shapes are created when you create a roundrect?
Define copy constructor.
which one is equivalent to multiplying by 2:Left shifting a number by 1 or Left shifting an unsigned int or char by 1?