Arnold wants to write program to convert the temperature from Celsius to Fahrenheit. To calculate the temperature, Arnold use the following formula:-
F = C *9/5 +32
Here, C is the temperature in Celsius and F is the temperature in Fahrenheit.Help Arnold to perform desired task.
Answer:-
public class TemperatureConversion {
public static void main(String[] args) {
double c;
double f;
c=89;
f= c * 9/5 + 32;
System.out.println("------------------------------------------");
System.out.println("Temperature in Fahrenheit ="+f);
System.out.println("------------------------------------------");
}
}
No comments:
Post a Comment