The program below is run. Which of the following COULD

Asked 9 months ago
Viewed 541076 times
1
NOT possibly be the output from that program?

2 Answer

2

The program is an illustration of random numbers

The output that is not possible is: 10 5 10 5

The possible numbers are:

  • On the first line, a random number between 1 and 10 (inclusive) is stored in variable a
  • On the second line, a random number between 10 and 20 (inclusive) is stored in variable b

The above highlights means that:

  • Variable a can only take values between 1 and 10
  • Variable b can only take values between 10 and 20

So, the third and the fourth lines would print the same value (i.e. a), while the last two lines would print the same values (i.e. b)

Hence, the output that is not possible is: 10 5 10 5

This is so because,

  • The first two outputs must be the same value (between 1 and 10)
  • The next two outputs must be the same value (between 10 and 20)

Read more about random numbers at:

brainly.com/question/20385238

Edit
avatar
Odell Barrows
15.5k 3 10 26
answered 9 months ago
2

Answer:

10 5 10 5

Explanation:

Edit
avatar
Kenyatta O'Keefe II
15.5k 3 10 26
answered 9 months ago