Javascript program to enter the temperature in Fahrenheit and convert it to Celsius
ADVERTISEMENTS
Javascript program to enter the temperature in Fahrenheit and convert it to Celsius. There are you will learn how to convert the temperature in Fahrenheit and convert it to Celsius in javascript language.
Formula:
C = (F - 32) * 5/9
Where:
F = fahrenheit
C = celsius
Let us understand this example through javascript program:
/* Javascript program to convert the temperature from degree fahrenheit to celsius */
<script type="text/javascript">
var c, f;
// c = celsius
// f = fahrenheit
/* Conversion of fahrenheit to celsius */
f = 7;
c = (f - 32) * (5 / 9);
document.write("Fahrenheit = " + c + " Celsius");
</script>
Output Screen:
Fahrenheit = -13.88888888888889 Celsius