Ask Question

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.

+2
Answers (1)
  1. 5 February, 06:44
    0
    The correct answer for the given question is "Underweight"

    Explanation:

    As the code is written in jа vascript, 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"
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “What message will be displayed after the execution of the following code segment? var BMI = 18; if (BMI>18.5) alert ("Overweight"); else ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers