What is the error in the following code, and when will it be caught?
Dim intValues(5) As Integer
Dim intIndex As Integer
For intIndex = 0 To 10
intValues(intIndex) = 10
Next intIndex
Select one:
A. The For...Next loop values for intIndex should range from 1 to 10. The error will occur at run time.
B. An IndexOutOfRangeException will be thrown.
C. The loop should close with Next instead of Next intIndex. The error will occur at compile time.
D. The For...Next loop values for intIndex should range from 1 to 5. The error will occur at compile time.
Answer: B