Question: Assume we have the following program for some language with C-like syntax. int x, y, z; void foo(a, b, c) {a = a*2; b =

 Assume we have the following program for some language with C-like

Assume we have the following program for some language with C-like syntax. int x, y, z; void foo(a, b, c) {a = a*2; b = b*2; x++; c = c+b;} x = 1; y = 2; z = 3; foo (x, y, z); What are the values of x, y, and z after the call to foo for each of the following cases? a) The formal parameters a, b, and c are all call-by-value? b) The formal parameters a, b, and c are all call-by-reference? c) The formal parameters a, b, and c are all call-by-value/result (i.e. in/out mode in Ada)? d) The formal parameters a, b, and c are all call-by-name

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!