Ask Question

Write a recursive, int - valued function, len, that accepts a string and returns the number of characters in the string.

+4
Answers (1)
  1. 16 October, 14:08
    0
    Without knowing the language, it's pretty imposible to write it. Once you start thinking recursively, it's not a difficult problem.

    While you're recursing, pass the string without the first character.

    The base case would be a null string which would return 0.

    The unwind would just add one and return that.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Write a recursive, int - valued function, len, that accepts a string and returns the number of characters in the string. ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers