When using a procedure the calling code sends data via the:

  1. actual argument to the formal parameter of the procedure.

  2. formal argument to the actual parameter of the procedure.

  3. actual parameter to the formal argument of the procedure.

  4. formal parameter to the actual argument of the procedure.

  5. All of the above.


Correct Option: A
Explanation:

To understand the question, the user needs to know about procedures and the concepts of formal and actual parameters.

When a procedure is called, data is passed from the calling code to the procedure. This data is referred to as the argument of the procedure, and can be either a value or a variable. The calling code specifies the argument by providing a value or a variable name.

Formal parameters are the parameter names declared in the procedure header, while actual parameters are the arguments passed to the procedure during the call.

Now, let's go through each option and explain why it is right or wrong:

A. actual argument to the formal parameter of the procedure.

This option is correct. The actual argument is the value or variable passed to the procedure during the call. It is assigned to the formal parameter, which is the parameter name declared in the procedure header.

B. formal argument to the actual parameter of the procedure.

This option is incorrect. The formal argument is not a commonly used term in programming. The parameter name declared in the procedure header is called the formal parameter, not the formal argument.

C. actual parameter to the formal argument of the procedure.

This option is incorrect. The actual parameter is the argument passed to the procedure during the call, while the formal argument is not a commonly used term in programming.

D. formal parameter to the actual argument of the procedure.

This option is incorrect. The formal parameter is the parameter name declared in the procedure header, while the actual argument is the value or variable passed to the procedure during the call.

E. All of the above.

This option is incorrect. Only option A is correct.

Therefore, the answer is: A. actual argument to the formal parameter of the procedure.

Find more quizzes: