Limited access

Upgrade to access all content for this subject

List Settings
Sort By
Difficulty Filters
Page NaN of 1947

Consider the following code segment.

 int[] a = {0, 2, 4, 1, 3};
 for (int i = 0; i < a.length; i++)
      a[i] = a[(a[i] + 3) % a.length];

What is the value of a[1] after the code is executed?

A

0

B

1

C

2

D

3

E

4

Accuracy 0%
Select an assignment template