float cel, kel;
cout << "Enter the temperature in Kelvin: ";
cin >> kel;
cel = kel - 273.15; //T(°C) = T(K) - 273.15
cout << "The temperature of " << kel << " in Celsius is: " << cel;
#include<iostream>
using namespace std;
float madam(float strict);
int main()
{
float kalvin;
float celsius;
cout<<"Please Enter your Tem in celsius=";
cin>>celsius;
kalvin=madam(celsius);
cout<<"
kalvin="<<kalvin<<".k"<<endl;
return 0;
}
float madam(float celsius)
{
float kalvin;
kalvin=(celsius+273.15);
return kalvin;
}
#include<iostream>
using namespace std;
float program(float mamo);
int main()
{
float kalvin;
float celsius;
cout<<"Please Enter your Tem in Kelvin=";
cin>>kalvin;
celsius=program(kalvin);
cout<<"
Celsius="<<celsius<<".C"<<endl;
return 0;
}
float program(float kalvin)
{
float celsius;
celsius=(kalvin-273.15);
return celsius;
}
float cel, kel;
cout << "Converting Celsius to Kelvin
";
cout << "------------------------------------";
cout <<"
";
cout << "Enter the temperature in Celsius: ";
cin >> cel;
kel = cel + 273.15; //T(K) = T(°C) + 273.15 (0 °C = 273.15 K )
cout << "The temperature of " << cel << " in Kelvin is: " << kel;