1.

What Are Actual And Formal Parameters ?

Answer»

Actual Parameters : Subprograms pass INFORMATION using parameters. The variables or expressions referenced in the parameter list of a subprogram call are actual parameters. For EXAMPLE, the following procedure call lists two actual parameters named emp_num and amount:

EG. raise_salary(emp_num, amount);

Formal Parameters : The variables DECLARED in a subprogram specification and referenced in the subprogram body are formal parameters. For example, the following procedure declares two formal parameters named emp_id and increase:

Eg. PROCEDURE raise_salary (emp_id INTEGER, increase REAL) IS current_salary REAL;

Actual Parameters : Subprograms pass information using parameters. The variables or expressions referenced in the parameter list of a subprogram call are actual parameters. For example, the following procedure call lists two actual parameters named emp_num and amount:

Eg. raise_salary(emp_num, amount);

Formal Parameters : The variables declared in a subprogram specification and referenced in the subprogram body are formal parameters. For example, the following procedure declares two formal parameters named emp_id and increase:

Eg. PROCEDURE raise_salary (emp_id INTEGER, increase REAL) IS current_salary REAL;



Discussion

No Comment Found