logo CodeStepByStep logo

arrayMysteryExam4

Language/Type: C++ arrays

Write the state of the array after each call to the following function when passed each of the following arrays and its length:

void arrayMysteryExam4(int a[], int length) {
    for (int i = 1; i < length; i++) {
        a[i] = a[length - 1 - i] - a[i - 1];
    }
}
{6, 2, 4}
{4, 2, 3, 1, 2, 5}
{6, 0, -1, 3, -2, 0, 4}

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.