Search
 
SCRIPT & CODE EXAMPLE
 

CPP

C++ Fahrenheit to Kelvin

	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;
Comment

C++ Converting Kelvin to Fahrenheit

	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;
Comment

c++ program to convert kelvin to fahrenheit

#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;
}
Comment

c++ program to convert fahrenheit to kelvin

#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;
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: dlopen failed: library "libomp.so" not found 
Cpp :: use regex replace in c++ 
Cpp :: cannot find "-lsqlite3" C++ 
Cpp :: xmake set exe name 
Cpp :: vector of structs c++ 
Cpp :: recursive power in c++ 
Cpp :: prime number program 
Cpp :: cout char32_t c++ 
Cpp :: arduino led code 
Cpp :: user input c++ 
Cpp :: using find in vector c++ 
Cpp :: hello world C++, C plus plus hello world 
Cpp :: how to print fixed places after decimal point in c++ 
Cpp :: OPA in expanse 
Cpp :: fabs() c++ 
Cpp :: array 2d dynamic allocation c++ 
Cpp :: capitalize first letter c++ 
Cpp :: g++ optimization flags 
Cpp :: Appending a vector to a vector in C++ 
Cpp :: how to find length of character array in c++ 
Cpp :: C++ switch - case - break 
Cpp :: c++ call by value vs call by reference 
Cpp :: how to install boost c++ on windows 
Cpp :: c++ char it is a number 
Cpp :: opencv c++ image write 
Cpp :: c++ segmented sieve primes 
Cpp :: Story of c++ 
Cpp :: c++ colored output 
Cpp :: read and write file in c++ 
Cpp :: c++ remove text file 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =