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

Write a program to find the Fibonacci series recursively.

621


Why is c++ difficult?

623


What is an adaptor class in c++?

614


What is endianness?

637


True or false, if you keep incrementing a variable, it will become negative a) True b) False c) It depends

1877






Is c++ primer good for beginners?

602


What is cout flush?

579


What is abstract class in c++?

598


Can non-public members of another instance of the class be retrieved by the method of the same class?

618


Is C++ case sensitive a) False b) Depends on implementation c) True

626


How can you quickly find the number of elements stored in a static array?

652


Why do we need pointers?

591


Is it possible to provide special behavior for one instance of a template but not for other instances?

643


What is do..while loops structure?

632


Assume an array of structure is in order by studentID field of the record, where student IDs go from 101 to 500. Write the most efficient pseudocode algorithm you can to find the record with a specific studentID if every single student ID from 101 to 500 is used and the array has 400 elements. Write the most efficient pseudocode algorithm you can to find a record with a studentID near the end of the IDs, say in the range from 450 to 500, if not every single student ID in the range of 101 to 500 is used and the array size is only 300

1801