1.

Observe the following program and find out, which output(s) out of (i) to (iv) will be expected from the program? What will be the minimum and the maximum value assigned to the variable Alter?Note: Assume all required header files are already being included in the program.void main( ){randomize();int Ar[]={10,7}, N;int Alter=random(2) + 10 ;for (int C=0;C<2;C++){N=random(2) ;cout<<Ar[N] +Alter<<”#”;}}(i) 21#20# (ii) 20#18#(iii) 20#17# (iv) 21#17#

Answer»

The output expected from the program is (iii) 20#17#

Minimum Value of Alter = 10

Maximum Value of Alter = 11



Discussion

No Comment Found

Related InterviewSolutions