logo CodeStepByStep logo

parameterMystery19sp3

The following code produces 4 lines of output. What is the output? Write each line of output as it would appear on the console.

void parameterMystery(int& a, int& b, int c) {
    a += c;
    c++;
    b--;
    cout << b << " " << a << " " << c << endl;
}

int main() {
    int w = 0;
    int x = 1;
    int y = 3;
    int z = 7;

    parameterMystery(y, x, w);
    parameterMystery(x, y, z);
    parameterMystery(w, w, z);

    cout << w << " " << x << " " << y << " " << z << endl;
    return 0;
}
line 1
line 2
line 3
line 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.