Question Detail

COS 102 test topic Objective Question

Question

In an array declared with bounds `A[0...9]`, what type of runtime error occurs when evaluating `A[10]`?
Options
A Type mismatch error
B Index out of bounds error
Correct Answer
C Syntax error
D Stack underflow error
Correct Answer

Option B is the correct answer.

Detailed Explanation

Indexing an array outside its allocated boundary (0 through 9) results in an out-of-bounds access or violation.

Hint

No hint available

Question Info