about | help | code help+videos | done | prefs |
Write a method that returns the largest digit in 'num'. You are NOT allowed to use any arrays, Strings, or other advanced classes (such as ArrayList, Map, etc.). Recursion IS allowed, but not required. Helper methods are also allowed, but not required. If you do write any helper methods, they must NOT use any of the things mentioned above as not being allowed. As a precondition, you may assume that 'num' is positive. Look at the test data for examples. test2024_01_22_P1SLHL_highestDigit(5326) → 6 test2024_01_22_P1SLHL_highestDigit(249002) → 9 test2024_01_22_P1SLHL_highestDigit(100101) → 1 ...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