Question: Given this pseudo code, fill in what is printed by the print statements program main; var I : integer; var a : array [ 1

Given this pseudo code, fill in what is printed by the print statements
program main;
var I : integer; var a : array [1..3] of integer;
procedure P (x, y : integer);
begin (P)
x := x -1;
if ( I <> x) then I := I +1;
y := y +3;
print(x, y);
x := x +5:
end; (P)
begin (main)
I :=2
a[1] :=1; a[2] :=3; a[3] :=7;
P (I, a[I]);
print(I, a[1], a[2], a[3]);
end
Give me the what is printed from each of the print statements assuming the following way that x and y are passed:
A) Value
B) Value-Result
C) Reference
D) Name

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!