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
Explain the difference between using macro and inline functions?
Which software is used for c++ programming?
What do you mean by volatile and mutable keywords used in c++?
Explain what are single and multiple inheritances in c++?
What is vector string in c++?
What is an operator in c++?
Describe delete operator?
How to declare an array of pointers to integer?
Is java as fast as c++?
Please explain the reference variable in c++?
Why do we use structure in c++?
Should the this pointer can be used in the constructor?
Why are pointers used?
Can you pass an array to a function in c++?
Where is atoi defined?