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
Get step-by-step solutions from verified subject matter experts
