0% found this document useful (0 votes)
336 views

Java Program To Convert Fahrenheit To Celsius Program PDF

This Java program allows a user to input a temperature in Fahrenheit and outputs the equivalent temperature in Celsius. The code imports necessary libraries, declares variables to store the user input temperature and converted temperature, gets the Fahrenheit temperature from the user, performs the conversion calculation to Celsius using the formula (F - 32) * 5/9, and prints out the temperature in Celsius.

Uploaded by

vinchooo
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
336 views

Java Program To Convert Fahrenheit To Celsius Program PDF

This Java program allows a user to input a temperature in Fahrenheit and outputs the equivalent temperature in Celsius. The code imports necessary libraries, declares variables to store the user input temperature and converted temperature, gets the Fahrenheit temperature from the user, performs the conversion calculation to Celsius using the formula (F - 32) * 5/9, and prints out the temperature in Celsius.

Uploaded by

vinchooo
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Java program to convert

Fahrenheit to Celsius
program

http://freepdf-books.com
Java program to convert Fahrenheit to
Celsius: This code does temperature
conversion from Fahrenheit scale to Celsius
scale.
Java programming code
import java.util.*;

class FahrenheitToCelsius {
public static void main(String[] args) {
float temperatue;
Scanner in = new Scanner(System.in);

System.out.println("Enter temperatue in Fahrenheit");


temperatue = in.nextInt();

temperatue = ((temperatue - 32)*5)/9;

System.out.println("Temperatue in Celsius = " +


temperatue);
}
}

Download Fahrenheit to Celsius program


class file.

http://freepdf-books.com
Output of program:

For Celsius to Fahrenheit conversion use


T = 9*T/5 + 32
where T is temperature on Celsius scale.
Create and test Fahrenheit to Celsius
program yourself for practice.

http://freepdf-books.com

You might also like