Q:

Write a Java program to convert Fahrenheit to Celsius

0

Java Program to convert Fahrenheit to celsius in Java programming, you have to ask to the user to enter the temperature in Fahrenheit temperature to convert it into celsius to display the equivalent temperature value in centigrade as shown in the following program.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

SOURCE CODE ::

import java.util.Scanner;
 
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);
  }
}

OUTPUT ::

Enter temperatue in Fahrenheit
87
Temperatue in Celsius = 30.555555

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now