This example will provide how to convert Fahrenheit into Celsius in Java.
Example:
package octopuscodes.com.demo;
import java.util.Scanner;
public class Demo {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Fahrenheit: ");
double fahrenheit = scanner.nextDouble();
double celsius = (fahrenheit - 32) / 1.8;
System.out.println("Celsius: " + celsius);
}
}
Output:
Fahrenheit: 212
Celsius: 100.0