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

c++ program to convert kelvin to celsius

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

PREVIOUS NEXT
Code Example
Cpp :: Max element in an array with the index in c++ 
Cpp :: c++ vector remove all duplicate elements 
Cpp :: c++ random generator 
Cpp :: print counting in c++ 
Cpp :: c++ output current timestamp 
Cpp :: c++ float and double 
Cpp :: c++ doubly linked list 
Cpp :: Visual studio code include path not working c++ 
Cpp :: c++ program to generate all the prime numbers between 1 and n 
Cpp :: SUMOFPROD2 
Cpp :: count number of prime numbers in a given range in c 
Cpp :: c++ get pointer from unique_ptr 
Cpp :: cpp template 
Cpp :: how to make a square root function in c++ without stl 
Cpp :: c ++ split_string 
Cpp :: c++ read matttrix from text file 
Cpp :: c++ insert variable into string 
Cpp :: cknuth hash 
Cpp :: uparam(ref) 
Cpp :: one dimensiol array to two dimen c++ 
Cpp :: vector<intv[] 
Cpp :: cmd color text c++ 
Cpp :: c++ formatting 
Cpp :: arduino falling edge 
Cpp :: has substr c++ 
Cpp :: how to find factorial of number in c++ 
Cpp :: split string in c++ 
Cpp :: c++ function pointer 
Cpp :: abs in c++ used for 
Cpp :: min heap 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =