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
Can you please explain the difference between overloading and overriding?
Why do we use classes in programming?
What is implicit pointer in c++?
Is recursion allowed in inline functions?
What is the use of default constructor?
How do you define a class in c++?
Describe Trees using C++ with an example.
What are the data types in c++?
Carry out conversion of one object of user-defined type to another?
Write a Program to find the largest of 4 no using macros.
Can java be faster than c++?
What is ios in c++?
Can you be bale to identify between straight- through and cross- over cable wiring? And in what case do you use straight- through and cross-over?
How would you use the functions randomize() and random()?
How can you differentiate between inheritance and implementation in c++?