Kelvin to Celsius
Lesson 6 of 10 in Coddy's Temperature Converter using C++ course.
Challenge
EasyAdd a function named kelvinToCelsius that gets a kelvin value (float) and returns its conversion to celsius (float).
The formula to convert from kelvin to celsius 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;
}
All lessons in Temperature Converter using C++
1Introduction
Overview2Converters
Celsius to FahrenheitCelsius to Kelvin