← Unit 2 · all exercises
Saved in this browser only

The bigger one, by hand

Return whichever number is larger, without calling Math.max.

int bigger(int a, int b)

Solution.java
Loading editor…
Results

Examples

  • bigger(3, 9) → 9
  • bigger(9, 3) → 9

There are also 3 hidden tests you can't see. Solve the problem, not the examples.