write program for palindrome

Answer Posted / darren chang

bool palind(string input)
{
int j=input.length()-1;
int i=0;
while(i<j)
{
if(input[i]!=input[j])
return false;
i++;
j--;
}
return true;
}

Is This Answer Correct ?    23 Yes 24 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the maximum value of a unsigned char a) 255 b) 256 c) 128

835


What are vtable and vptr?

853


What is pure virtual function? Or what is abstract class?

796


What is a pointer with example?

863


How many ways can a variable be initialized into in C++?

772


What is the best it certification?

815


How to defines the function in c++?

813


What does the following do: for(;;) ; a) Illegal b) Loops forever c) Ignored by compiler...not illegal

917


What is near, far and huge pointers? How many bytes are occupied by them?

869


What is low level language in simple words?

786


Explain about Virtual Function in C++?

767


Why do we use setw in c++?

846


Describe new operator and delete operator?

828


Explain one-definition rule (odr).

851


What is tellg () in c++?

996