Given a positive integer , find the sum of its digits. For example, if , the answer is . You will use recursion.
The key point: you can split into its last digit () and the remaining digits (). Then the sum is last digit plus the sum of the rest. This gives you a natural recursive structure. Before reading the solution, try to identify the base case yourself. When is the answer obvious without recursion?