Menu
Coddy logo textTech

Kelvin to Fahrenheit

Lesson 7 of 10 in Coddy's Temperature Converter using C++ course.

challenge icon

Challenge

Easy

Add a function named kelvinToFahrenheit that gets a kelvin value (float) and returns its conversion to fahrenheit  (float).

The formula to convert from kelvin to fahrenheit is:

Try it yourself

float celsiusToFahrenheit(float celsius) {
    return (celsius * 9.0 / 5.0) + 32.0;
}

double celsiusToKelvin(double celsius) {
    return celsius + 273.15;
}

double fahrenheitToCelsius(double fahrenheit) {
    return (fahrenheit - 32.0) * 5.0 / 9.0;
}

double fahrenheitToKelvin(double fahrenheit) {
    return (fahrenheit + 459.67) * 5.0 / 9.0;
}

double kelvinToCelsius(double kelvin) {
    return kelvin - 273.15;
}

All lessons in Temperature Converter using C++