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