write a jav program to convert fahrenheit to centigrate (hint : c = (5/9)*F-32)
Answers
Answered by
23
Answer:
Java program to convert Fahrenheit to Celcius :
import java.util.* ;
class FahrenheitToCelsius
{
public static void main(String[] args)
{
float temperature;
Scanner in = new Scanner(System.in);
System.out.println("Enter temperature in Fahrenheit");
temperature = in.nextInt();
temperature = ((temperature - 32)*5)/9;
System.out.println("temperature in Celsius = " + temperature);
}
}
Answered by
2
Explanation:
import java.util.*;
// Compiler version JDK 11.0.2
class Farentocel
{
public static void main(String args[])
{
double temp;
Scanner sc=new Scanner (System.in);
System.out.println("enter the temperature");
temp=sc.nextDouble();
System.out.println("celsius temp="+(
(temp-32)*5)/9);
}
}
Attachments:
Similar questions
Social Sciences,
6 months ago
English,
6 months ago
Hindi,
6 months ago
Accountancy,
1 year ago
Biology,
1 year ago
Math,
1 year ago