Question: Consider the following program. Write out the values in the write statements in the case that Y is transmitted to P 1) by value, 2)

Consider the following program. Write out the values in the write statements in the case that Y is transmitted to P 1) by value, 2) by result, 3) by value-result, 4) by reference, 5) by name. program main( ) var Y: integer; procedure P(X: integer); begin

X := X + 1;

write (X, Y)

end; begin

Y := Y+ 1;

P(Y);

write(Y)

end.

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 Databases Questions!