Question: 3. Consider the following code written using Pascal syntax: var x,y: integer; (* global variables *) procedure f(a: integer, b: integer); var z: integer;
3. Consider the following code written using Pascal syntax: var x,y: integer; (* global variables *) procedure f(a: integer, b: integer); var z: integer; begin (* f *) b; Z : = X - := a y b end; - Z; = a + 1; begin (* main *) X := 2; y : = 3; f (x + y, y); end; Describe the effect of this program on the global variables x and y, assuming: a) call by reference as the underlying mechanism for passing parameters. b) textual substitution as the underlying mechanism for passing parameters.
Step by Step Solution
3.38 Rating (154 Votes )
There are 3 Steps involved in it
Lets analyze the provided Pascal code and its effects on the global variables x and y under the assu... View full answer
Get step-by-step solutions from verified subject matter experts
