I have the following if/else I am having trouble with, it is displaying both the if and the else and I am lost as to what to do with it, heres the code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
//Display weight category in if/else 18.5 to 25
if (displayBmi <= 18.4)
{
// Output underweight
cout << "You are currently underweight, eat more!\n";
}
if (displayBmi >= 25.1)
{
// Output overweight.
cout << "You are currently overweight. Put the cake DOWN!\n";
}
else
{
// Output optimal.
cout << "You are currently in the optimal BMI category, great job!\n";
}
this is for a BMI calculator and no matter the bmi number it will display the underweight "if" AND the else, which is the optimal. So i want it to basically say.
If bmi is less than or equal to 18.4 then its underweight
if bmi is greater than or equal to 25.1 then its overweight
If it is in between those two ranges it is optimal