Decode School

Free Certification Courses from

Java Program to calculate Fahrenheit to Celsius

Sample Input 1:

Enter the Fahrenheit: 284

Sample Output 1:

The Celsius Is :140

Program or Solution

import java.util.*;
class FaToCe
   public static void main(String args[])
       double fahreheit,celsius;
       Scanner sc=new Scanner(;
       System.out.println("Enter The Fahrenheit:");
       System.out.println("The Celsius Is:"+celsius);

Program Explanation

Get Fahrenheit as input (using scanner class) Calculate Celsius using Formula celsius=(fahreheit-32)*0.5556 print Celcius (using system.out.println).