Question: 3. Consider the following pseudo-code in an imperative language: int x = 1, n = 1; function f () { int x = 3;

3. Consider the following pseudo-code in an imperative language: int x =  

3. Consider the following pseudo-code in an imperative language: int x = 1, n = 1; function f () { int x = 3; function g (int c,d) { c = c-1; print (c,d,x,n); } /* end of g */ /* body of f */ g(x,x); } /* end of f */ function h () { 2; int n = f(); } /* end of h */ main() { h(); } a) What is the output, when call by value and static scoping is used? b) What is the output when call by reference and dynamic scoping is used?

Step by Step Solution

3.42 Rating (168 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Answer Lets analyze the pseudocode provided We have two functions defined f and h In f theres a loca... View full answer

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 Programming Questions!