← Unit 2 · all exercises
Saved in this browser only

Ice, water or steam

Given a temperature in Celsius, return "ice" at 0 or below, "steam" at 100 or above, and "water" in between.

String state(int celsius)

Solution.java
Loading editor…
Results

Examples

  • state(20) → water
  • state(-10) → ice

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