Skip to content

Commit

Permalink
Update bmiCalculator.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Harshitha-Killi committed Apr 30, 2022
1 parent 36d4cf4 commit 240e3c3
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions bmiCalculator.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
// Method-1

function bmiCalculator(weight,height){
var bmi= weight/(height*height)
return Math.round(bmi);
var bmi= weight/(height*height);

if(bmi<18.5){
return("Your BMI is " +bmi+ ". So, you are underweight.");
}

else if(bmi>18.5 && bmi<24.9){
return("Your BMI is " +bmi+ ". So, you have a normal weight.");
}

else if(bmi>24.9){
return("Your BMI is " +bmi+ ". So, you are overweight.");
}

}


// Method-2

0 comments on commit 240e3c3

Please sign in to comment.