id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

jebbert@volusia.k12.fl.us > test2024_01_22_P1SLHL_highestDigit
prev  |  next  |  chance

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)

public int test2024_01_22_P1SLHL_highestDigit(int num) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 250

Copyright Nick Parlante 2017 - privacy