celsiusToFahrenheit

Easy · Mathematical Calculations · 2 test cases

The algorithm to convert from Celsius to Fahrenheit is the temperature in Celsius times 9/5, plus 32.

Examples

celsiusToFahrenheit(30) → 86
celsiusToFahrenheit(0) → 32

Starter code

function celsiusToFahrenheit(celsius) {

}

Complexity of the optimal solution

Time O(1), space O(1). This function performs a fixed set of arithmetic operations. The time taken does not change based on the input value, so it is constant time and uses constant space.

Solve celsiusToFahrenheit in the browser