This is a Java Program to Convert Fahrenheit into Celsius.
formula:
temperature in celsius = (temperature in fahrenheit – 32)*(0.5556)
Enter the temperature in Fahrenheit and now using the mentioned formula we get the desired output.
formula:
temperature in celsius = (temperature in fahrenheit – 32)*(0.5556)
Enter the temperature in Fahrenheit and now using the mentioned formula we get the desired output.
Here is the source code of the Java Program to Convert Fahrenheit into Celsius. The Java program is successfully compiled and run on a Windows system. The program output is also shown below.
import java.util.Scanner;
public class Fahrenheit_Celsius
{
public static void main(String[] args)
{
double celsius, fahrenheit;
Scanner s = new Scanner(System.in);
System.out.print("Enter temperature in Fahrenheit:");
fahrenheit = s.nextDouble();
celsius = (fahrenheit-32)*(0.5556);
System.out.println("Temperature in Celsius:"+celsius);
}
}
Output:
$ javac Fahrenheit_Celsius.java $ java Fahrenheit_Celsius Enter temperature in Fahrenheit:15 Temperature in Celsius:-9.4452
Sanfoundry Global Education & Learning Series – 1000 Java Programs.
advertisement
advertisement
Here’s the list of Best Books in Java Programming, Data Structures and Algorithms.
If you find any mistake above, kindly email to [email protected]Related Posts:
- Apply for Computer Science Internship
- Apply for Java Internship
- Practice BCA MCQs
- Practice Programming MCQs
- Check Programming Books