A function is given information in the form of a parameter. Within the function, parameters function as variables.
Within the parentheses after the function name, parameters are supplied collectively. The arguments within the parenthesis are separated by commas.
Different parameters have different names.
Formal Parameters
As a result, the variable defined in the function is referred to as a formal parameter or simply a parameter. Variables a and b, for example, are formal parameters.
int sum(int a, int b){
//function body
}
Actual Parameters
Actual parameters, also referred to as arguments, are the values that are supplied to the function. Examples of arguments include the numbers num1 and num2.
int sum(int a, int b);
int main()
{
int num1 = 5;
int num2 = 6;
sum(num1, num2);//actual parameters
}
A function does not need parameters and does not have to return a value.