Solved

What Is the Error in the Following Code, and When

Question 32

Multiple Choice

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


A) The For...Next loop values for intIndex should range from 1 to 10. The error will occur at run time.
B) The loop should close with Next instead of Next intIndex. The error will occur at compile time.
C) An IndexOutOfRangeException will be thrown
D) The For...Next loop values for intIndex should range from 1 to 5. The error will occur at compile time.

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions