Created
October 2, 2021 22:07
-
-
Save sayyedhammadali/e9f254cfb9ee8753e926432777aee1c2 to your computer and use it in GitHub Desktop.
Convert Fahrenheit / Celsius
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const celsiusToFahrenheit = (celsius) => celsius * 9/5 + 32; | |
const fahrenheitToCelsius = (fahrenheit) => (fahrenheit - 32) * 5/9; | |
// Examples | |
celsiusToFahrenheit(15); // 59 | |
celsiusToFahrenheit(0); // 32 | |
celsiusToFahrenheit(-20); // -4 | |
fahrenheitToCelsius(59); // 15 | |
fahrenheitToCelsius(32); // 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment