about | help | code help+videos | done | prefs |
Write a method that has an integer parameter. As a precondition, you may assume that this integer parameter will be a 3-digit positive number. Return the sum of the digits of that number. Look at the test data for examples. test2024_10_08_P1SLHL_sumDigits(782) → 17 test2024_10_08_P1SLHL_sumDigits(111) → 3 test2024_10_08_P1SLHL_sumDigits(123) → 6 ...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: 250
Copyright Nick Parlante 2017 - privacy