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

 

pais@kinetigram.com logic04 > L410_maxMod5
prev  |  next  |  chance

APCS Logic 4, Problem 10. Given two int values, return whichever value is larger. However if the two values have the same remainder when divided by 5, then the return the smaller value. However, in all cases, if the two values are the same, return 0. Note: the % "mod" operator computes the remainder, e.g. 7 % 5 is 2.


L410_maxMod5(2, 3) → 3
L410_maxMod5(6, 2) → 6
L410_maxMod5(3, 2) → 3

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

public int L410_maxMod5(int a, int b) { }

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

Copyright Nick Parlante 2017 - privacy