Question: Consider the following code. program MAN; var i : integer; var a : array [ 1 . . 5 ] of integer; procedure SUB (
Consider the following code.
program MAN;
var i : integer;
var a : array of integer;
procedure SUB : integer;
;:;:;;:;; endSUBPROG
:;:;:;:;:;:;
call SUB;
print;
NOTE: Assume that all uninitialized variables have the value zero.
a What is the program output assuming that the parameter is passed by value?
b What is the program output assuming that the parameter is passed by result?
Assume that the address of the pass by result parameter is bound at the time of call.
c What is the program output assuming that the parameter is passed by result?
Assume that the address of the pass by result parameter is bound at the time of return.
d What is the program output assuming that the parameter is passed by valueresult?
Assume that the address of the pass by result parameter is bound at the time of call.
e What is the program output assuming that the parameter is passed by reference?
f What is the program output assuming that the parameter is passed by name?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
