Actual arguments:
The arguments that are passed in a function call are called actual arguments. These arguments are defined in the calling function.
Formal arguments:
The formal arguments are the parameters/arguments in a function declaration. The scope of formal arguments islocal to the function definition in which they are used. Formal arguments belong to the called function. Formal arguments are a copy of the actual arguments. A change in formal arguments would not be reflected in theactual arguments.
Example:
#include<stdio.h>
void sum(int i, int j, int k);
/* calling function */
int main()
{
int a = 5;
// actual arguments
sum(3, 2 * a, a);
return 0;
}
/* called function */
/* formal arguments*/
void sum(int i, int j, int k)
{
int s;
s = i + j + k;
printf("sum is %d", s);
}
Here 3,2*a,a are actual arguments and i,j,k are formal arguments.