Learn
Code Challenge: C++ Functions
Palindrome

is_palindrome()

Instructions

1.

Define a function is_palindrome() that takes:

  • An std::string parameter text.

The function should return:

  • true if text is a palindrome.
  • false if text is not a palindrome.

(A palindrome is any text that has the same characters backwards as it does forwards. For example, “hannah” and “racecar” are palindromes, while “menu” and “ardvark” are not.)

We will not test for edge cases such as capitalization or spaces.

Folder Icon

Take this course for free

Already have an account?