Multiple Choke 33 forint a0 aSolution 33 Answer C20 In the f
Solution
33) Answer: C.20
In the for loop, variable \'a\' value is initiated with 0 and executes the loop upto a<20.
that means 0 to 19 (where 19<20 and it stops the executing when a=20 because 20 is not less than 20)
hence the answer is : 20
------------------------------------------------------
34) Answer: C.6
here initially x value is 1.
and loop executes 5 times where variable \'a\' value ranges from 0 to 4.
And in the loop we have x=x+1;
So,
initially x=1;
loop 1 => x value becomes 2 by executing expression x=x+1;
loop 2 => x value becomes 3 by executing expression x=x+1;
loop 3 => x value becomes 4 by executing expression x=x+1;
loop 4 => x value becomes 5 by executing expression x=x+1;
loop 5 => x value becomes 6 by executing expression x=x+1;
hence the answer is: x=6
------------------------------------------------------
35) Answer: B.5
int myArray[10]={1,2,3,4,5,6,7,8,9,10}
myArray has 10 elements. And usually indexes in any array starts from 0.
Generally index used to locate the exact location/position of element in the array.
that means
myArray[0] = 1
myArray[1] = 2
myArray[2] = 3
myArray[3] = 4
myArray[4] = 5
.
.
.
.
myArray[9] = 10
here 4th element of myArray is 5. That is x = myArray[4] = 5;
hence the answer is 5.
