Java Program for Fahrenheit to Celsius Conversion
Program in Java to convert Fahrenheit to Celsius
import java.util.*;
public class FahrenheitToCelsius {
public static void main(String[] args) {
float temperatue;
Scanner in = new Scanner(System.in);
System.out.println("Enter temperatue in Fahrenheit");
temperatue = in.nextInt();
temperatue = ((temperatue - 32)*5)/9;
System.out.println("Temperatue in Celsius = " + temperatue);
}
}
Enter temperatue in Fahrenheit
101
Temperatue in Celsius = 38.333332
Output
Enter temperatue in Fahrenheit
Temperatue in Celsius = 38.333332
No comments :
Post a Comment