Java Snippet: Convert Fahrenheit to Celsius



Learn Java with simple programming examples.
This snippet converts a temperature in degrees Fahrenheit to the equivalent temperature in degrees Celsius

Source Code

  1. Type (or copy) the program shown below into your computer, compile it, and then run it.
  2. Modify the line fahr = 98.6; to convert the temperature 32.0.
  3. What result do you expect?
  4. Compile and run it to see if you were correct.

Compile and Run Screenshot


Leave a Reply