Celsius to Fahrenheit

Report a typo

Write a program that reads a temperature in Celsius (°C) and shows its equivalent in Fahrenheit (°F).

Use the following formula:

F = C * 1.8 + 32

where C is a temperature in Celsius and F is the corresponding temperature in Fahrenheit.

Sample Input 1:

32.9

Sample Output 1:

91.22

Sample Input 2:

0

Sample Output 2:

32.0
Write a program in Java 17
import java.util.Scanner;

class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
// put your code here
}
}
___

Create a free account to access the full topic