Multiple choice technology programming languages

Given the following code fragment: int A[]; int i = 0; A = new int A[4]; while (i < 4) { A[i] = 10; i = i + 1; } What is the value of A[3]?

  1. 0

  2. 3

  3. 10

  4. Compile Error

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The while loop runs 4 times (i = 0, 1, 2, 3), assigning 10 to each array index. A[3] is the fourth element and receives the value 10.