Consider the following method, mystery2: What are the values of the elements in array a1 after the

Question:

Consider the following method, mystery2:

public static void mystery2 (int [] a, int[] b) { for (int i = 0; i < a.length; i++) { %3D a[i] = a[2 * i % a.length] - b[3 * i % b.length];

What are the values of the elements in array a1 after the following code executes?

int[] a1 = {2, 4, 6, 8, 10, 12, 14, 16};
int[] a2 = {1, 1, 2, 3, 5, 8, 13, 21};
mystery2(a1, a2);

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: