Convert Celsius to Fahrenheit
• javascriptbeginnercoding-challengelogicmathtemperaturepractice
Challenge Convert a temperature from Celsius to Fahrenheit in JavaScript.
Write a function that takes a Celsius value and returns the Fahrenheit equivalent using the formula: F = C × 9/5 + 32
Complete code:
function celsiusToFahrenheit(c) { return c * 9 / 5 + 32;
} console.log(celsiusToFahrenheit(25));
Question: What should the console print for the input 25?
Multiple choice:
- 67
- 77
- 82
- 98
Tip: Mind operator precedence and return a number, not a string.