Run ❯
Get your
own Java
server
❯
Run Code
Ctrl+Alt+R
Change Orientation
Ctrl+Alt+O
Change Theme
Ctrl+Alt+D
Change Language
Go to Spaces
Ctrl+Alt+P
public class Main { static void convert(int celsius) { double fahrenheit = celsius * 9.0 / 5 + 32; System.out.println(celsius + " Celsius = " + fahrenheit + " Fahrenheit"); } public static void main(String[] args) { convert(25); convert(0); convert(100); convert(-40); convert(37); } }
25 Celsius = 77.0 Fahrenheit
0 Celsius = 32.0 Fahrenheit
100 Celsius = 212.0 Fahrenheit
-40 Celsius = -40.0 Fahrenheit
37 Celsius = 98.6 Fahrenheit