Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assume a language, L, that combines both static and dynamic scoping: all variables (global, parameters and local) that start with the prefix static_ follow static

Assume a language, L, that combines both static and dynamic scoping: all variables (global, parameters and local) that start with the prefix "static_" follow static scope; others starting with the prefix "dynamic_" follow dynamic scoping. Show all the outputs of the following program.

int static x: / global statically scoped variable int dvnamic t int dynanie yi 1 giobal dynanicaliy scoped variab le void f(int static x) t //local variable static dynamicy = dynamicy- 1; print f (11%d dyn,,, staticx, dynamicy); if (staticx <= 0) return; else - - - - - gistaticx-1): print f (、、%d %d n, staticx, dynamicy); - - void g(int dynamic y //local variable dynamic y staticx staticx -1; print f (、Yed dyn, ,, staticx, dynamicy); if (dynamicy<= 0) return; else - - - - - f (dynamic y-1) print f (%d %d n, staticx, dynamicy); - - void main) f staticx := 3; fistatic x); print f い, ddin,,, staticx, dynamicy); 3; dynamic !y := 2; - - - 

int static x; // global statically scoped variable int dynamic y; // global dynamically scoped variable void f(int static x) (//local variable static x dynamic y printf *d *d '', static x, dynamic_y): if (static x

Step by Step Solution

3.40 Rating (163 Votes )

There are 3 Steps involved in it

Step: 1

Desired o... 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_2

Step: 3

blur-text-image_3

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

Microeconomics

Authors: Austan Goolsbee, Steven Levitt, Chad Syverson

1st Edition

978-1464146978, 1464146977

More Books

Students also viewed these Programming questions

Question

Help with required 1

Answered: 1 week ago

Question

What is an insurable interest? Why is it important?

Answered: 1 week ago

Question

Summarize Lazaruss cognitive appraisal approach to stress.

Answered: 1 week ago

Question

Identify some biological bases of personality.

Answered: 1 week ago