parameter passing strategy in a semi-C code

36 views Asked by At

it's a problem in my assignment. Following code written in semi-C language. Set parameter passing type for f, g and h functions in order to have 29, 34 and 43 at the end of execution.for instance, for acquiring 29 we have to use call-by-value in f,g and h . but I don't know what should I do for 34 and 43?

f(x) {return g(2*x);}

g(x) {let y = 1 in {h(y); return x + y + x;}}

h(x) {x = x + 5; return 0}

main() {printf(f(7));}
0

There are 0 answers