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

 

amjadm@miamioh.edu > maxDigit
prev  |  next  |  chance

Given an int of digits with the length of greater than equal 1, return the biggest digit if the boolean parameter max is true. If max is false, then the smallest digit needs to be returned.


maxDigit(1112, true) → 2
maxDigit(3421, false) → 1
maxDigit(0, true) → 0

...Save, Compile, Run (ctrl-enter)

public int maxDigit(int num, boolean max) { }

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: 110

Copyright Nick Parlante 2017 - privacy