Menu
Question Index
...

Write a program to convert between celsius and fahrenheit.
Note that 'C = 5(F - 32)/9'



class CelsiusToFahrenHeit
{
    public static void main(String s[])
    {
        System.out.println("98.4 degrees fahrenheit is same as " + fahrenheitToCelsius(98.4) + " celsius");
        System.out.println("100 degrees celsius is same as " + celsiusToFahrenheit(100) + " fahrenheit");
        System.out.println("-40 degrees celsius is same as " + celsiusToFahrenheit(-40) + " fahrenheit");

    }


    public static double fahrenheitToCelsius(double fahrenheit)
    {
        double celsius = 0;
        return celsius;
    }
    
    public static double celsiusToFahrenheit(double celsius)
    {
        double fahrenheit = 0;
        return fahrenheit;
    }

}

Doubts

Problems

Topic: Basic Arithmetic Operators In Java

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App