✨hola guys!! ✨
# ❎❎NO SPAMS❎❎#
what is the difference between actual paremeter and formal parameter ?(give 2 points)❣️
the 1st one to answer my question correctly with nice explanation will be marked as brainliest ✌️
so guys go for it ❣️
Answers
Actual Parameter is the method in which we declare values to the variables.
Formal parameter is the parameter which contains some other values and variables than those in the actual parameter.
Formal parameter is used to call the actual parameter.
Actual arguments:
(i) Actual arguments are values that are passed to a function when it is invoked.
(or)
The values that are passed to the called function from main function are actual parameters.
(ii) These are passed by the calling function.
Formal Arguments:
(i) Formal parameters variables declared in the function prototype (or) declaration.
(ii) These are in the called function (or) they belong to the called function.
Example:
void sum(int);
int main()
{
int a = 5;
printf("The value of a = %d", a);
sum(a);
return 0;
}
void sum(int b)
{
b++;
printf("The value of b = %d", b);
}
Output:
The value of a = 5
The value of b = 6
Explanation:
The variable b is called as formal parameter and the variable a is called as actual parameter.
Hope it helps!