Sunday, February 6, 2022

Convert Celsius in Fahrenheit Java Eclipse

 import java.util.Scanner;

public class h1 {


public static void main(String[] args) {

Scanner in = new Scanner( System.in );

System.out.print( "Enter a temperature in Celsius: ");

double celsius = in.nextDouble();

System.out.printf("The temperature is %,.2f in Fahrenheit.\n",

(9.0/5.0*celsius) + 32 );

}


}


No comments: