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
Get step-by-step solutions from verified subject matter experts
