Solved

What Is the Error in the Following Code, and When

Question 9

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

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents