Fahrenheit to Celsius

Write a Program to convert the given temperature in Fahrenheit to Celsius using the following conversion formula C=F-32/1.8 and display the value in a tabular form.

PROGRAM:

import java.util.Scanner;
class P5
{
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter Temperature in Fahrenheit:=");
double f=sc.nextDouble();
double c=(f-32)/1.8;
System.out.println("Temperature in Celsius:="+c);
System.out.println("Temperature in Fahrenheit     "+"=      Temperature in Celsius");
System.out.println(f+"                                          =      "+c);
}
}

OUTPUT:

 

(Visited 1,365 times, 1 visits today)
Share with Friends :
Written by:

One thought on “Fahrenheit to Celsius In JAVA

  • 20/08/2018 at 10:56 pm
    Permalink

    Thanks for the excellent manual

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *