Question: A non-recursive function called sumDigits) will sum up all the digits in a given number and then return this sum via reference. Here is that





A non-recursive function called sumDigits) will sum up all the digits in a given number and then return this sum via reference. Here is that function defined non-recursively. 20 /on-recursive sum of digits 21 void sumDigits (long& sum, long num) 22- 23, while (num>0){ 24 25 26 27 sum = sum + num%10 ; numnum/10; Here is the function prototype 2 #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
