Write the JavaScript code for deriving Celsius from Fahrenhe
Write the JavaScript code for deriving Celsius from Fahrenheit and displaying it in an alert dialog box
Solution
\\\\HTML CODE
<button id=\"btn\">Begin</button>
\\\\JavaScript
$(document).ready(function () {
        $(\"#btn\").click(
             function () {
                 bl();
             }          
         );
     });
function f2c(inputF)
 {
 return (inputF - 32) * (5/9);
 }
function bl() {
 var inputF = 0;
 while (inputF != 999) {
 var inputF = prompt(\"Enter degrees in Fahrenheit \ \" + \"Entering 999 will end the process\", \"999\");
 var inputF = parseInt(inputF);
 var cdegree = f2c(inputF);
 alert(\"Fahrenheit=\" + inputF + \"\ Celsius=\" + cdegree);
 }
     if (inputF == 999) {
         alert(\"Process Completed\");
     }
 }

