Question: Parameter Passing Example from a Previous Exanm void main() int aM[] = {10, 20, 30} int k = 2; sub(aM[k], k); print ('main', k, aM[0],
![Parameter Passing Example from a Previous Exanm void main() int aM[]](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3e65f2ef84_25466f3e65ebe324.jpg)
Parameter Passing Example from a Previous Exanm void main() int aM[] = {10, 20, 30} int k = 2; sub(aM[k], k); print ('main', k, aM[0], aM[1], aM[2]); void sub(int x, int y) x += 3; printf('sub', x, y); Trace and show the output produced by the code using the following parameter transmission schemes: a. by value b. by true reference c. by copy-restore reference d. by name Problem a. by value aM 10 20 30 Problem b. by true ref aM 10 20 30 main k 2 k 2 sub Output sub sub main main Problem c. by copy-restore aM 10 20 30 Problem d. by name aM 10 20 30 main k 2 k 2 sub Output sub sub main main
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
