Solved

What Is Stored in Alpha After the Following Code Executes

Question 18

Multiple Choice

What is stored in alpha after the following code executes? int[] alpha = new int[5]; for (int j = 0; j < 5; j++) {alpha[j] = 2 * j; if (j % 2 == 1) alpha[j - 1] = alpha[j] + j;}


A) alpha = {0, 2, 4, 6, 8}
B) alpha = {3, 2, 9, 6, 8}
C) alpha = {0, 3, 4, 7, 8}
D) alpha = {0, 2, 9, 6, 8}

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions