70.2k views
21 votes
Consider the following code segment

Consider the following code segment-example-1
User Shf
by
4.2k points

1 Answer

10 votes

Answer:

D:

2

54

Step-by-step explanation:

In line 3 Math.random() will return a number between 0 and 1, so the minimum is 3 (0*5+3=3), therefore it is impossible for line 4 to return the value 2

User Notjustme
by
3.4k points