Question: Consider the following program: ` ` ` Program main; var a , b : integer; begin x: = x + 2 ; a : =

Consider the following program:
```
Program main;
var a, b : integer;
begin
x:= x +2;
a := x*y;
x:= x +1
end;
begin
a :=2; b :=3;
p(a,b);
end.
```
procedure p(x, y : integer);
write(a, b)//prints out the value of a and b
Manually execute the program by assuming
(a) pass by value
(b) pass by value-result
(c) pass by reference
(d) pass by name.
What is the output generated for each of the above calls. Show the workings of each by showing the value at each statement inside the function.
Consider the following program: ` ` ` Program

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!