Datasets:

ArXiv:
License:
File size: 522 Bytes
c574d3a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import java.util.Scanner;

/**
 * This program will convert the temperature in Fahrenheit to Celsius
 */
public class FahrenheitToCelsiusConverter {
    public static void main(String arg[]) {
        double a;
        Scanner sc = new Scanner(System.in);
        System.out.println("Enter  Fahrenheit temperature");
        a = sc.nextDouble();
        System.out.println("Celsius temperature is = " + celsius(a));
        sc.close();
    }

    static double celsius(double f) {
        return (f - 32) * 5 / 9;
    }
}