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 is the difference between an external iterator and an internal iterator?
what is VOID?
What is the two main roles of operating system?
What is a syntax in c++?
What can c++ be used for?
What is diamond problem in c++?
How do you invoke a base member function from a derived class in which you have not overridden that function?
What is #include iomanip?
Can a new be used in place of old mallocq? If yes, why?
What is data hiding c++?
Which of the following is evaluated first: a) && b) || c) !
What is c++ hash?
Evaluate the following expression as C++ would do :8 * 9 + 2 * 5 a) 82 b) 79 c) 370 d) list
How do you instruct your compiler to print the contents of the intermediate file showing the effects of the preprocessor?
What is the error in the code below and how should it be corrected?