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


Please Help Members By Posting Answers For Below Questions

Is ca high or low level language?

580


What language does google use?

582


Explain the pure virtual functions?

627


What programming language should I learn first?

582


What is setbase c++?

619






What does new in c++ do?

560


Why are pointers used?

569


What are the benefits of pointers?

588


Explain what data encapsulation is in c++?

566


Can notepad ++ run c++?

536


State two differences between C and C++.

604


What is difference between class and function?

577


What does std mean in c++?

575


Write a Program for read a line from file from location N1 to N2 using command line arguments. Eg:exe 10 20 a.c

790


Explain what are mutator methods in c++?

566