Java Programs

Please click on 1-2 Ads to keep this website's Study Material FREE and regularly Updated.

Program 4: Write a Java program to convert temperature in Celsius to Fahrenheit.

Convert.java

import java.util.Scanner;

public class Convert
{
	public static void main(String[] args)
	{
		//Declaring Variables
		double Celsius;
		double Fahrenheit;
		
		Scanner sc=new Scanner(System.in);
		System.out.println("Enter the Temperature in Celsius");
		Celsius=sc.nextDouble();

		Fahrenheit=((Celsius*9.0)/5.0)+32;
		System.out.println(Celsius+" =  "+Fahrenheit);
	}
}



If you have any suggestion or found any error in the above program, then do let us know at [email protected] or just comment below.