Considering the following code segment:

if ( num <0) {

alert("It's a negative num.");

}

else {

alert("It's a non-negative num.");

}

What will be displayed if num=0?

It's a positive num.

It's a non-negative num.

It's a zero.

Nothing will be displayed.

Respuesta :

Answer:

It's a non-negative num.

Explanation:

As the value of num=0 is given in the input.First it will check "if(num<0)" condition,

here this condition false. Then it will check "else" condition and give an alert as

"It's a non-negative num.".In there is "if-else" condition given, only one of them

will be executed based on their TRUE value.