write program for palindrome
Answer Posted / chintan
#include<iostream.h>
#include<conio.h>
#include<string.h>
void main()
{
clrscr();
char *a,*b,s1[10],s2[10];
cout<<"\n ENTER THE STRING : ";
cin>>s1;
strcpy(s2,s1);
a=s1;
b=s2;
strrev(s2);
cout<<s2;
if(strcmp(a,b))
cout<<" \n STRING IS NOT PALINDROME ";
else
cout<<" \n STRING IS PALINDROME ";
getch();
}
| Is This Answer Correct ? | 35 Yes | 31 No |
Post New Answer View All Answers
How the programmer of a class should decide whether to declare member function or a friend function?
Explain the benefits of proper inheritance.
If you don’t declare a return value, what type of return value is assumed?
What are manipulators used for?
Evaulate: 22%5 a) 2 b) 4 c) 0
Which c++ compiler is best?
What does new do in c++?
Can we define a constructor as virtual in c++?
What is a NULL Macro? What is the difference between a NULL Pointer and a NULL Macro?
How does a copy constructor differs from an overloaded assignment operator?
How to get the current position of the file pointer?
What is c++ & why it is used?
Give the difference between the type casting and automatic type conversion. Also tell a suitable C++ code to illustrate both.
Does c++ have string data type?
Why is c++ still best?