Problem Statement - 01F
Study the following program and select the possible output(s)from the option (i) to (iv) following it. Also write the maximum and the minimum values that can be assigned to the variable NUM.
Note:
– Assume all required header files are already being includedin the program.
– random(n) function generates an integer between 0 and n-1.
void main() { randomize(); int NUM; NUM=random(3)+2; char TEXT[]=”ABCDEFGHIJK”; for (int I=1;I<=NUM; I++) { for (int J=NUM;J<=7;J++) cout<<TEXT[J]; cout<<end1; } }
(i)FGHI (ii) BCDEFGH (iii) EFGH (iv) CDEFGH FGHI BCDEFGH EFGH CDEFGH FGHI EFGH FGHI EFGH
Solution
CSKC| Created: 4-Jan-2019 | Updated: 5-Jan-2019|CBSE12D-2015