Consider the following pseudo-code. For each of the following parameter passing mechanisms, give the

Consider the following pseudo-code. For each of the following parameter passing mechanisms, give the value returned for every function call, in the order that the returns occur. Then give the output produced by the program. Assume operands are evaluated leftto-right and values are copied back left-to-right, where appropriate. For example, if f3 is the first function to return and it returns a value 17, simply write something like A????1f3 returns 17.A????1

(a) Value (b) Reference (c) In Out

int p = 5; int q = 1; int f1(int b, int c) { b = 2 * c; c = 3 + b; return b + c; } int f2(int a, int b) { return f1(b, a) * f1(a, a); } print f1(p,q) + f2(p, f1(p,q));

 

Looking for a Similar Assignment? Hire our Top Uk Tutors while you enjoy your free time! All papers are written from scratch and are 100% Original. Try us today! Active Discount Code FREE15