The intSales array is declared as follows: Dim intSales() As Integer = {10000, 12000, 900, 500, 20000}. Which of the following loops will correctly add 100 to each array element? The intSub variable contains the number 0 before the loops are processed.

[amp_mcq option1=”Do While intSub <= 4 intSub = intSub + 100 Loop" option2="Do While intSub <= 4 intSales = intSales + 100 Loop" option3="Do While intSub < 5 intSales(intSub) =intSales(intSub) + 100 Loop" option4="Do While intSub <6 intSales(intSub) = intSales(intSub) + 100 Loop" correct="option3"]

The correct answer is C.

Option A will not work because it only increments the intSub variable, not the array elements.

Option B will not work because it adds 100 to the entire array, not each element.

Option C will work because it increments the intSub variable and then adds 100 to the corresponding array element.

Option D will not work because it increments the intSub variable past the end of the array.

Here is an example of how Option C would work:

“`
Dim intSales() As Integer = {10000, 12000, 900, 500, 20000}
Dim intSub As Integer = 0

Do While intSub < 5
intSales(intSub) = intSales(intSub) + 100
intSub = intSub + 1
Loop

Console.WriteLine(intSales(0)) // 20000
Console.WriteLine(intSales(1)) // 22000
Console.WriteLine(intSales(2)) // 1000
Console.WriteLine(intSales(3)) // 600
Console.WriteLine(intSales(4)) // 21000
“`