What will be assigned to the dblAvg variable after the code has been executed? Do While intSub < 4 intNums(intSub) = intTotal + intTotal intSub = intSub + 1 Loop dblAvg = intTotal / intSub Dim intNums() As Integer = {10, 5, 7, 2}. The intTotal, intSub, and dblAvg variables contain the number 0 before the loops are processed.

0
5
6
8

The answer is C.

The code will first assign the value 10 to the intTotal variable. Then, it will assign the value 10 + 10 = 20 to the intNums(0) variable. Next, it will increment the intSub variable by 1, so it will now have the value 1. Then, it will repeat the process, assigning the value 20 + 20 = 40 to the intTotal variable, and the value 40 to the intNums(1) variable. It will continue this process until the intSub variable is equal to 4, at which point it will exit the loop. The intTotal variable will now have the value 10 + 20 + 40 = 70, and the intSub variable will have the value 4. The dblAvg variable will then be assigned the value 70 / 4 = 17.5.

Option A is incorrect because the intTotal variable will have the value 70 after the code has been executed.

Option B is incorrect because the intNums(0) variable will have the value 10, and the intNums(1) variable will have the value 20.

Option D is incorrect because the intTotal variable will have the value 70 after the code has been executed, and the intSub variable will have the value 4.

Exit mobile version