asked 10.0k views
5 votes
When this function is called, the smaller of two numbers is displayed. What Boolean expression would not work in line 12 in order to accomplish this goal?

asked
User Mohru
by
8.5k points

1 Answer

4 votes

Answer:


\mathbf{num1 == num2}

Step-by-step explanation:

The missing program is written as:

1 var
num1 = 5;

2 var
num2 = 7;

3 smallest ( ) ; →

4

5
num1 = 8;

6
num2 = 4;

7 smallest ( ) ; →

8

9 function smallest () {→

10
console.log ( "What is smallest? " +
num1 + " or " +
num2 + " ? " ) ;

11

12 if (< insert code>) {

13
console.log(
num1 + " is the smallest.") ;

14 } else {

15
console.log(
num2 + " is the smallest.") ;

}

}

So from above, the Boolean expression that would not work in line 12 is:


\mathbf{num1 == num2}

answered
User Calandoa
by
8.1k points