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
What are the advantages of pointers?
What are static member functions?
What is problem with overriding functions?
When should you use global variables?
If you want to share several functions or variables in several files maitaining the consistency how would you share it?
what is the difference between linear list linked representaion and linked representation? what is the purpose of representing the linear list in linked represention ? is it not avoiding rules of linear represention?
When should overload new operator on a global basis or a class basis?
What is ios :: in in c++?
Why was c++ made?
What are the c++ access specifiers?
Differentiate between declaration and definition.
Can I learn c++ as my first language?
What's the order in which the objects in an array are destructed?
What is a constructor in c++ with example?
Write about c++ storage classes?