Fahrenheit to Celsius Program in Java
°C = (°F – 32) / (9/5)
import java.util.Scanner;
public class JavaFarenheitToCelsius
{
public static void main(String[] args)
{
float c,f;
Scanner sc=new Scanner(System.in);
System.out.print("Enter Fahrenhiet=");
f=sc.nextFloat();
c=((f-32)*5)/9;
System.out.println("Celcius="+c);
}
}
Output:
Enter Fahrenhiet=102 Celcius=38.88889b. tech. bca icse java java tutorials learn java mca programs