Datasets:

ArXiv:
License:
Stack-Repo / data /train /rghvgrv /Simple-Programs /Java-Programs /FahrenheitToCelsiusConverter.java
denisko's picture
cnanged dir structure and removed features file
3e77472
raw
history blame contribute delete
522 Bytes
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;
}
}