kelvin to celsius converter in js code example
Example 1: javascript celcius to farenheit
const celsiusToFahrenheit = celsius => celsius * 9/5 + 32;
const fahrenheitToCelsius = fahrenheit => (fahrenheit - 32) * 5/9;
celsiusToFahrenheit(15);
fahrenheitToCelsius(59);
Example 2: convert fahrenheit to celsius formula javascript
<!DOCTYPE html>
<html>
<head>
<title>Fahrenheit From Celsius</title>
</head>
<body>
<script>
var cTemp = 100;
var hTemp = ((cTemp * 9) /5 ) + 32;
document.write("Temperature in Celsius: " + cTemp + " degrees<br/>");
document.write("Temperature in Fahrenheit: " + hTemp + " degrees");
</script>
</body>
</html>