BMI Calculator beginner

pull/896/head
MUHAMMAD SHAF HAMEED 3 years ago committed by GitHub
parent 120204995f
commit c3a2d69701
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,52 @@
<!DOCTYPE html>
<html>
<head>
<title>BMI</title>
</head>
<body>
<script type="text/javascript">
var weight = parseInt(prompt("Enter Weight KG : "));
var height = parseInt(prompt("Enter height CM:"));
function BMI(w,h)
{
// var result= weight/(height*height);
// document.write("Your BMI :");
let result= (weight / ((height * height)
/ 10000)).toFixed(2);
document.write("which show");
if (result > 18 && result < 24)
{
document.write("your BMI is Normal : " +result);
}
else if (result > 24)
{
document.write("you are overweight and BMI : " +result);
}
else
{
document.write("you are underweight and BMI : " +result);
}
}
BMI(weight,height);
</script>
</body>
</html>
Loading…
Cancel
Save