Fahrenheit To Celsius In Java
Chapter:
Math Class
Last Updated:
04-05-2016 18:38:33 UTC
Program:
/* ............... START ............... */
public class JavaFahrenheitToCelsius {
public static void main(String[] args) {
double temp = 98.6;
System.out.println("Fahrenheit: " + temp);
temp = (temp - 32) * 5 / 9;
System.out.println("Celsius: " + temp);
}
}
/* ............... END ............... */
Output
Celsius: 100.0
Fahrenheit: 212.0
Tags
Fahrenheit To Celsius, Java, Math