In programming languages, a separate named unit of code that performs a specific calculation or procedure. To use functions, they must be declared in a special area of the program set aside for this purpose.
A function includes placeholders, called logical parameters, that will be replaced by real values (actual parameters) when the function is initiated through a call placed elsewhere in the program.
For example, the following pseudocode adds two numbers and displays the result: add(x, y) {sum = x + y; print sum;} The variables within the parentheses (x, y) are the logical parameters that will be replaced with actual parameters. Elsewhere in the program, a statement such as the following calls and supplies the actual parameters: add(5,10) See actual parameter, call, parameter, parameter passing convention.