Tuesday, November 25, 2014

Convert Fahrenheit to Celsius In Java

Program:

import java.util.Scanner;
public class f2c {
public static void main(String[] arrgs){
Scanner in=new Scanner(System.in);
double x,result;
System.out.println("Enter temperature in farenhiet: ");

x=in.nextDouble();
result=((x-32)*5)/9;
System.out.println("The temperature converts into celcius and that is: "+result);

}

}

Output:

Enter temperature in farenhiet:
278.15
The temperature converts into celcius and that is: 136.75

Screenshots

Program


Output



No comments: