What message will be displayed after the execution of the following code segment?

var BMI = 18;

if(BMI>18.5)

alert( "Overweight");

else

alert("Underweight");

Overweight

Underweight

Both Overweight and Underweight

randomly display either Overweight or Underweight.

Respuesta :

Answer:

The correct answer for the given question is "Underweight"

Explanation:

As the code is written in javascript , we see that var BMI hold the value 18,so In the if block we check the condition  "18>18.5 " this condition is false so it executed the else block  i.e it print " Underweight" .

So the correct answer for the following code is " Underweight"