In each of the cases below, write down the values of x, y and z after the following calls to foo() as well as the return value of the function foo(). If necessary, assume that output arguments are copied back to parameters in the left-to-right order. For each answer, briefly explain why? a. foo(y,z) where all parameters are call by value
b. foo(y,z) where all parameters are call by reference
c. foo(y,z) where all parameters are call by value-result
d. foo(x,y) where all parameters are call by reference
e. foo(x,x) where all parameters are call by reference
f. foo(x,x) where all parameters are call by value-result

Solved
Show answers

Ask an AI advisor a question