The correct answer is C.
The name of each argument in the Call statement does not need to be identical to the name of its corresponding parameter in the procedure header. For example, the following code is valid:
“`
procedure Add(x, y: Integer);
begin
Result := x + y;
end;
begin
Add(1, 2);
Writeln(Result);
end.
“`
In this code, the Add
procedure is called with the arguments 1
and 2
, but the parameters in the procedure header are named x
and y
.
A, B, and D are all true statements.
A. The sequence of the arguments listed in the Call statement should agree with the sequence of the parameters listed in the receiving procedure’s header.
B. The data type of each argument in the Call statement should match the data type of its corresponding parameter in the procedure header.
D. When you pass information to a procedure by value, the procedure stores a copy of each value it receives in a separate memory location.