Computer Science, asked by tejaswinichowdhary, 8 months ago


(f) The following code is from a game, which generates a set of 4 random
numbers. Ravi is playing this game, help him to identify the correct option(s)
out of the four choices given below as the possible set of such numbers
generated from the program code, so that he wins the game. Also, find out
the minimum and maximum value that can be assigned to the variable
Number used in the code at the time when value of I is 2.
(2)
Note ► Assume all required header files are already being included in the program.
random(n) function generates an integer between 0 and n-1
const int a 15;
void main()
randomize();
int POINT 5, Number:
for(int i=1;I<=4; I++)
{
Number = a+random(POINT):
cout<<Number<<":";
POINT--;​

Answers

Answered by pandeypubge
0

Answer:

Explanation:

I random(I) New (char)New

Min Max Min Max Min Max

1 0 0 65 65 A A

2 0 1 65 66 A B

3 0 2 65 67 A C

4 0 3 65 68 A D

From the above table, it is clear that option (ii) will not be expected output (since when I =2, then C cannot be there in

the output. Similarly, option (iii) will not be expected as when I =1, 2 and 3 then output cannot be B, C and D

respectively.

Option (iv) is also not possible, when I =1 then output cannot be C.

and plz make me brainlist

Similar questions