Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts Of Programming Languages

Authors: Robert Sebesta

11th Edition

013394302X, 978-0133943023

More Books

Students also viewed these Programming questions

Question

What are antecedents? Consequences?

Answered: 1 week ago