import java.util.Scanner; public class Main { public static void main(String[] args) { Double celsius,fahrenheit; Scanner s=new Scanner(System.in); System.out.println("Enter temperature in Celsius: "); celsius=s.nextDouble(); //Conversion formula: Fahrenheit = (Celsius * 9/5) + 32 fahrenheit=(celsius*9/5)+32; System.out.println(celsius+" degrees Celsius is equal to "+fahrenheit+" degrees Fahrenheit"); } }
Enter temperature in Celsius: 28
28.0 degrees Celsius is equal to 82.4 degrees Fahrenheit