Write a Java program to convert temperature from Fahrenheit to Celsius degreeTest DataInput a degree in Fahrenheit: 212Expected Output:212.0 degree Fahrenheit is equal to 100.0 in Celsius
import java.util.Scanner; public class Exercise1 { public static void main(String[] Strings) { Scanner input = new Scanner(System.in); System.out.print("Input a degree in Fahrenheit: "); double fahrenheit = input.nextDouble(); double celsius =(( 5 *(fahrenheit - 32.0)) / 9.0); System.out.println(fahrenheit + " degree Fahrenheit is equal to " + celsius + " in Celsius"); } }
Sample Output:
Input a degree in Fahrenheit: 212 212.0 degree Fahrenheit is equal to 100.0 in Celsius
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer