about | help | code help+videos | done | prefs |
recursiveDigitSum() -- Given a non-negative integer n, write a recursive function that returns the sum of the digits of n. NOTE: You may not use any loops (for or while), nor may you convert n to a String. You'll probably want to use the % and / operators. recursiveDigitSum(111) → 3 recursiveDigitSum(123) → 6 recursiveDigitSum(908841) → 30 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Copyright Nick Parlante 2017 - privacy