logo CodeStepByStep logo

parameter_mystery2

Language/Type: C parameter mystery
Author: Allison Obourn (on 2020/09/14)

The following console program uses parameters and produces two lines of output. What are they?

void mystery(int x, int z, int y) {
    printf("%d and %d\n", z, y - x);
}

int main() {
    int x = 9;
    int y = 2;
    int z = 5;
    mystery(z, y, x);
    mystery(y, x, z);
    return 0;
}
line 1 output:
line 2 output:

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.