Explain what Is The Difference Between Formal And Actual Parameters In A Subprogram Specification?

Category: QuestionsExplain what Is The Difference Between Formal And Actual Parameters In A Subprogram Specification?
Editor">Editor Staff asked 2 years ago

Explain what Is The Difference Between Formal And Actual Parameters In A Subprogram Specification?

1 Answers
Editor">Editor Staff answered 2 years ago

Formal parameters are variables declared as the parameter list in the subprogram specification.
Actual parameters are the values that are passed to the subprogram from the calling environment. The actual parameter values are evaluated and resultant values are assigned to the formal parameters when the program is executed. Both formal and actual parameters should be of compatible datatypes. Following code shows the formal parameters of the function:

In the preceding function, p_student_id and p_percentage are the formal parameters.
In the following function code, v_student_id and v_percentage are the actual parameters:
proc_disp_percentage (v_student_id, v_percentage);