Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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 () { int n = 2; 
 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

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

Beyond Big Data Using Social MDM To Drive Deep Customer Insight

Authors: Martin Oberhofer, Eberhard Hechler

1st Edition

0133509796, 9780133509793

More Books

Students also viewed these Databases questions

Question

Experimental mortality: Did participants drop out during the study?

Answered: 1 week ago

Question

5.6 Describe alternatives to recruitment?

Answered: 1 week ago

Question

5.4 Identify external recruitment sources.

Answered: 1 week ago