write program for palindrome

Answer Posted / amit

#include<iostream.h>
#include<conio.h>
main()
{
char c[8];
cout<<"enterd hte world of polindorom";
cin>>c;
int i=strlen(c);
i=i-1;
int flag=0;
for(int j=0;j<=1;j++)
{
if(c[j]==c[i])
{
flag=1;
}
else
{
int flag=0;
break;
}
}
i--;
if(flag==1)
{
cout<<"your option is polindorome";
}
else
{
cout<<"your option is not polindorome";
}
getch();
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is virtual base class?

567


What is one dimensional array in c++?

573


What is scope resolution operator in c++ with example?

549


What is the difference between while and do while loop?

550


What does ctime() do?

611






How are pointers type-cast?

639


What are the rules for naming an identifier?

553


Do you know the use of vtable?

629


Define copy constructor.

618


How is c++ used in the real world?

567


Define a nested class.

611


Name the debugging methods that are used to solve problems?

576


What are structs in c++?

596


Incase of a function declaration, what is extern means?

513


What is ctime c++?

571