Exercise 3: Sum of Digits Using Recursion

Let's calculate the sum of digits of a number by using recursion.

Problem Statement

In this exercise, you have to write a function digitSum that calculates the sum of digits of a number using recursion.

Sample input

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy