Question: Consider a recursive function sumDigitsR(num) that returns the sum of the digits of the input parameter, which is an integer called num. It can be
Consider a recursive function sumDigitsR(num) that returns the sum of the digits of the input parameter, which is an integer called num. It can be assumed that 'num' is a non-negative
For example: sumDigitsR(1983) = 21.
Which of the following is a valid base case for the recursive function sumDigitsR?
Question options:
|
|
Both num < 10 and num <= 0 |
|
|
len(num) == 0 |
|
|
None of the answers are correct |
|
|
num < 10 |
|
|
num <= 0
|
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
