about | help | code help+videos | done | prefs |
Write a method that returns the sum of the odd digits of the input parameter 'num'. For example, 5821 has four digits, but only 5 and 1 are odd digits. The sum of those odd digits is 6, so if 'num' was 5821 you would return 6. Look at the test data for additional examples. No use of strings is allowed for this problem. nov21_2019_P1SLHL_sumOddDigits(325) → 8 nov21_2019_P1SLHL_sumOddDigits(3428) → 3 nov21_2019_P1SLHL_sumOddDigits(864002) → 0 ...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: 290
Copyright Nick Parlante 2017 - privacy