Example 48: The Sum of the Digits of a Number
Write a recursive function that takes in a positive integer as input and calculates the sum of its digits.
Try it yourself
Try to solve this question on your own in the code widget below. If you get stuck, you can always refer to the solution provided.