Question: 9. Considering the following code segment: if ( num <0) { alert(It's a negative num.); } else { alert(It's a non-negative num.); } What will

9.

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.

10.

Considering the following code segment:

if(x>y) {

y=x;

}

else if (x == y){

x=1000;

}

else{

y =100;

}

alert ( 'x=' + x + ', y = '+y);

Given x=0 and y=5, what will be displayed?

x=0, y=5

x=0, y=100

x=1000, y=100

x=0, y=0

11.

If variable answer stores a Boolean value, then what are the possible values for the variable?

0 or 1

"true" or "false"

true or false

any value

12.

Suppose variables roll1 = 3 and roll2 = 4, which of the following will be evaluated as true?

roll1>3 || roll2 > 3

roll1>3 && roll2 > 3

!(roll1==3)

roll1>3 || roll2 < 3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!