logo

Cambridge IGCSE Computer Science practice

What will happen if you try to access an index that is out of bounds?

Try the question first, then check the answer and practise the same topic again.

At a glance

MCQ

Type

cambridge_mcq

Style

Topic

Arrays

Exam-style question

Try this first

What will happen if you try to access an index that is out of bounds?.

  1. A.The program will run normally
  2. B.An error will occur
  3. C.The last element will be returned
  4. D.The first element will be returned

Answer and explanation

Concise answer

An error will occur

Why this is correct

Accessing an out-of-bounds index typically results in a runtime error.

Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.

Common mistake

No common mistake is linked to this question yet.

Related flashcards

Flashcard 1 of 6

Press Space to flip, arrows to move

Related practice questions