Question: int a b, c; void g) { } int fint a) int b; b= a + 1; (); print (); } } int a;

int a b, c; void g) { } int fint a) int 

int a b, c; void g) { } int fint a) int b; b= a + 1; (); print (); } } int a; int si c = b; a = b + c; (); } int main() { Consider the following program written in C syntax // first declaration // parameter declaration. // second declaration. // first call // third declaration // fourth declaration // second call return a bi // third call int a 2; // fifth declaration a = f(a); g_(); // fourth call 1. If static scoping is used, the reference to a in the first call to gi) resolves to which declaration? 2. If static scoping is used, the reference to a in the third call to g() resolves to which declaration? 3. If dynamic scoping is used, the reference to a in the first call to g) resolves to which declaration? 4. If dynamic scoping is used, the reference to a in the third call to g) resolves to which declaration? 5. What is the output of this program if static scoping is used? 6. What is the output of this program is dynamic scoping is used?

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