Question: int a[ ] = { 3, 2, 1, 0 }; void guessWhat(int x, int y) { x = x + 2; y = y +

int a[ ] = { 3, 2, 1, 0 }; void guessWhat(int x, int y) { x = x + 2; y = y + 1; a[x] = a[y] + 2; } int b = 1; guessWhat(b, a[b]);

What are the values of array a and variable b after the call to the subprogram guessWhat returns when: (a) Pass-by-value is used , (b) Pass-by-result is used , (c) Pass-by-value-result is used, (d) Pass-by-reference is used, Assume that the language uses 0-based indices for arrays and an uninitialized variable is set to a default value, e.g., 0 for int variables.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!