Question:
Look at the following C++ code and find the possible output(s) from the options (i) to (iv) following it. Also, write the maximum and the minimum values that can be assigned to the variable PICKER.
Note:
– Assume all the required header files are already being included in the code.
– The function random(n) generates an integer between 0 and n-1
void main()
{
randomize().
int PICKER.
PICKER=1+random(3).
char COLOR[][5]={"BLUE","PINK","GREEN","RED"}.
for(int I=0.I<=PICKER. I++)
{
for(int J=0. J<=I.J++)
cout<<COLOR[J].
cout<<endl.
}
}
| (i) | (ii) | (iii) | (iv) |
|---|---|---|---|
| PINK | BLUE | GREEN | BLUE |
| PINKGREEN | BLUEPINK | GREENRED | BLUEPINK |
| PINKGREENRED | BLUEPINKGREEN | BLUEPINKGREEN | |
| BLUEPINKGREENRED |
C. Sir| Created: 1-Jan-2019 | Updated: 22-Mar-2026|CBSE12A-2016
