Convert Fahrenheit to Celsius: - Javascript Function

Javascript examples for Function:Function Return

Description

Convert Fahrenheit to Celsius:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<p id="demo"></p>

<script>
function toCelcius(f) {/*  w  w  w  .  j ava2 s  . c  o  m*/
    return (5/9) * (f-32);
}

document.getElementById("demo").innerHTML = toCelcius(32);
</script>

</body>
</html>

Related Tutorials