Limited access

Upgrade to access all content for this subject

List Settings
Sort By
Difficulty Filters
Page NaN of 1946

The code segment

int[] x = {5,10,15,20,25};

is equivalent to which of the following?

I.

int[] x = new int[5];
for (int i = 0; i < x.length; i+=5)
     x[i] = i;

II.

int[] x = new int[5];
for (int i = x.length; i >= 0; i--)
     x[i] = i*5 + 5;

III.

int[] x = new int[5];
for (int i = x.length-1; i >= 0; i--)
     x[i] = 5*(i + 1);

IV.

int[] x = new int[5];
for (int i : x)
{
     i*=5;
     i+=5;
}
A

I only.

B

III only.

C

II and III only.

D

I, II, and III only.

E

I, II, III, and IV.

Accuracy 0%
Select an assignment template