Question: ( 1 2 % ) Write a recursive function int sumDigits ( int x ) ; that returns the sum of all the digits in
Write a recursive function int sumDigits int ; that returns the sum of all the digits in You can assume that cannot be negative. Eg the calls sumDigits and sumDigits shall return and respectively. You are not allowed to use any forloop, whileloop, or dowhileloop in this question.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
