← Unit 1 · all exercises
Saved in this browser only

The bigger one

Return whichever of the two numbers is larger. If they are equal, return that value.

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.