Write the JavaScript code for deriving Celsius from Fahrenheit and displaying it in an alert dialog box
\\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 \n" + "Entering
999 will end the process", "999");
var inputF = parseInt(inputF);
var cdegree = f2c(inputF);
alert("Fahrenheit=" + inputF + "\nCelsius=" + cdegree);
}
if (inputF == 999) {
alert("Process
Completed");
}
}
Get Answers For Free
Most questions answered within 1 hours.