We are going to use below formula to Write a Program to Convert Fahrenheit to Celsius in Java
Formula to convert Fahrenheit to Celsius is below:-
temperature in celsius = (temperature in fahrenheit – 32)*(0.5556)
import java.util.Scanner; public class FahrenheitToCelsius { public static void main(String[] args) { double celsius, fahrenheit; Scanner s = new Scanner(System.in); System.out.print("Enter the temperature In Fahrenheit to Convert in celsius:"); fahrenheit = s.nextDouble(); celsius = (fahrenheit-32)*(0.5556); System.out.println("After Conversion Temperature in Celsius is :" +celsius); } }
Output:-