Java Program to Convert Celsius to Fahrenheit
Java Program to convert celsius to Fahrenheit in Java Programming, you have to ask to the user to enter the temperature in celsius to convert it into Fahrenheit to display the equivalent temperature in Fahrenheit as shown in the following program.
SOURCE CODE ::
import java.util.Scanner; public class CelsiusToFahrenheit { public static void main(String args[]) { float cen; double fah; Scanner scan = new Scanner(System.in); System.out.print("Enter Temperature in Celsius : "); cen = scan.nextFloat(); fah = (1.8*cen) + 32; System.out.println("Temperature in Fahrenheit = " + fah); } }
OUTPUT ::
Enter Temperature in Celsius : 32 Temperature in Fahrenheit = 89.6