Task 6 of 10 · 0 solved · 10 to go0%
You can read the problem, but answers are checked only for signed-in students. Sign in to answer →

5.5 Recursion — sum of digits

Total: 0 / 3 pts
Practice mode — check each part and get hints as you go.
Task

Fill in sumDigits so that it returns the sum of the digits of n, recursively.

Hint: n % 10 is the last digit and n / 10 is the rest. The program prints 7 and then 10.

Your solution