about | help | code help+videos | done | prefs |
Write a method that accepts any prime integer as an input parameter. Return the sum of the digits of that prime number. You must solve this problem using recursion in a non-trivial way and without using any string commands. You may assume the input parameter is prime and do not need to do any verification of this fact. finalExam2014digitSumPrimes(472882049) → 44 finalExam2014digitSumPrimes(393342743) → 38 finalExam2014digitSumPrimes(65537) → 26 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 450
Copyright Nick Parlante 2017 - privacy