import java.util.Scanner;
public class MyClass
{
public static void main(String[] args)
{
try
{
Scanner in = new Scanner(System.in);
System.out.print("Enter Temperature in Fahrenheit: ");
int temp_f = in.nextInt();
double temp_c = FahrenheitToCelsius(temp_f);
System.out.format("%d Fahrenheit = %.2f Celsius\n", temp_f, temp_c);
}
catch (Exception e)
{
System.out.println(e.toString());
}
}
static double FahrenheitToCelsius(int f)
{
double t;
t = (f - 32.0) / 1.8;
return t;
}
}
/*
run 1:
Enter Temperature in Fahrenheit: 1
1 Fahrenheit = -17.22 Celsius
run 2:
Enter Temperature in Fahrenheit: 50
50 Fahrenheit = 10.00 Celsius
*/