← Back to Gists

Convert Celsius to Fahrenheit

📝 JavaScript
theresawilliams366
theresawilliams366 · Level 2 ·

This JavaScript snippet converts a Celsius temperature to Fahrenheit using the formula (C ร— 9/5) + 32.

JavaScript
function celsiusToFahrenheit(celsius) { return (celsius 9/5) + 32;
} const celsius = 25;
const fahrenheit = celsiusToFahrenheit(celsius);
console.log(`${celsius}ยฐC = ${fahrenheit}ยฐF`);

Comments

No comments yet. Start the discussion.