C++ Program to Convert Kelvin to Celsius

In this article, we are going to do the Cpp program in which we are going to convert the temperature from kelvin to Celsius. The program is very simple and easy, Basically, the temperature is in kelvin and just you need to convert this temperature to Celsius.

Now let’s see some examples that you will understand easily.

C++ Program to Convert Kelvin to Celsius

Example-

Example 1- Input-Enter Temperature in kelvin:300
Output-The temperature in celsius is 26.85
Example 2- Input-Enter Temperature in kelvin:150.5
Output-The temperature in celsius is -122.65

How can we do this-

In this program, we do have not much to do we only have to take the temperature in kelvin as user input from the user and now we need to apply the formula to convert the temperature from kelvin to celsius,
formula:

celsius =kelvin-273.15

Program-

# include<iostream>
using namespace std;
int main()
{
float cel,kel;
cout<<“Enter Temperature in kelvin :”;
cin>>kel;
cel=kel-273.15;
cout<<“The temperature in celsius is “<<cel;
return 0;
}

Output-

Enter Temperature in kelvin:450
The temperature in celsius is 176.85

Program Explanation-

First of all, we have declared the variable to store celsius and kelvin.
Then we have taken input kelvin from the user.
Then we applied the formula cel=kel-273.15.
In the end, we have printed the celsius.

Conclusion-
In this way, we have seen the Cpp program convert the temperature from kelvin to celsius. We hope that you have understood the code and you will explore it even more!