Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I Static and Dynamic Scoping. Consider the following program written in the C syntax. int a, b, c, x, y, z; void print (int p)

image text in transcribed

I Static and Dynamic Scoping. Consider the following program written in the C syntax. int a, b, c, x, y, z; void print (int p) if (p-0) else if (p1) else if (p-2) printf("f: %d printf("g: %d printf ("main: %d %d %d %d %d %d %d %d %d %d ", a, %d ", a, %d %d ", b, b, a, x, x, b, z); z); y, z); y, y, x, int f(int x, int y) int a- 10 b100 c-1000; x = g(10); int y yg(x) int x; x = a+b; b -g(a) print (0); print (0) return x a-y*b+z*c; int g (int a) print (1) a = 2*a ; b = 2*b; y = 2*y; return (x t y-z) * ai int main() int c-1; a10; x = 100; y = 1000; z-f (x, y) z-g (a) print (2) return 0 1) 2) What is the output of this program if static scoping is used? What is the output of this program if 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

Database Concepts

Authors: David M Kroenke, David J Auer

6th Edition

0132742926, 978-0132742924

More Books

Students also viewed these Databases questions

Question

Does the numerical analysis add value for the individual?

Answered: 1 week ago

Question

Ask the person to identify with whom they will share the feedback.

Answered: 1 week ago