float far, kel;
cout << "Enter the temperature in Fahrenheit: ";
cin >> far;
kel = (far + 459.67) * 5/9; //T(K) = (T(°F) + 459.67)× 5/9
cout << "The temperature of " << far << " in Kelvin is: " << kel;
float far, kel;
cout << "Enter the temperature in Kelvin: ";
cin >> kel;
far = 1.8 * (kel - 273.15) + 32; //° F = 9/5(K - 273) + 32
//or ° F = 9/5(K - 273.15) + 32
cout << "The temperature of " << kel << " in Fahrenheit is: " << far;
#include<iostream>
using namespace std;
float program(float mamo);
int main()
{
float kalvin;
float fahrenhiet;
cout<<"Please Enter your Tem in Kelvin=";
cin>>kalvin;
fahrenhiet=program(kalvin);
cout<<"
Fahrenhiet="<<fahrenhiet<<".F"<<endl;
return 0;
}
float program(float kalvin)
{
float fahrenhiet;
fahrenhiet=(9/5*(kalvin-273.15)+32);
return fahrenhiet;
}
#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 fahrenhiet;
cout<<"Please Enter your Tem in Fahrenhiet=";
cin>>fahrenhiet;
kalvin=program(fahrenhiet);
cout<<"
Kelvin="<<kalvin<<".k"<<endl;
return 0;
}
float program(float fahrenhiet)
{
float kalvin;
kalvin=(5/9*(fahrenhiet-32)+273.15);
return kalvin;
}