Computer Science, asked by tauseeftaiba, 4 months ago

write a java program to take the temperature from user in celsius and display the output by converting it into kelvin .​

Answers

Answered by sanskrutisgupta16
1

Answer:

the program is written below

Explanation:

// Java program to convert temperature 

// from degree Celsius to kelvin

import java.io.*;

  

class GFG {

    // function to convert temperature

    // from degree Celsius to Kelvin

    static float Celsius_to_Kelvin(float C)

    {

        return (float)(C + 273.15);

    }

      

    // Driver function

    public static void main (String[] args) 

    {

        // variable to hold the 

        // temperature in Celsius

        float C = 100;

      

        System .out.println ( "Temperature in Kelvin ( K ) = "

                             + Celsius_to_Kelvin(C));

              

    }

}

Similar questions