Tuesday, 16 January 2018

Core Java Practice Program

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

Error While embed the video in Your website page

Error:- Refused to display '<URL>' in a frame because it set 'X-Frame-Options' to 'sameorigin Solution:- if ...