Formal and Actual parameters in C
Below is the implementation of Formal and Actual Parameters in C:
#include <stdio.h>
// a and b are formal parameters
int sum_numbers(int a, int b) { return a + b; }
int main()
{
// 3 and 5 are actual parameters
int result = sum_numbers(3, 5);
printf("Sum: %d\n", result);
return 0;
}
Output
Sum: 8
Formal and Actual Parameters in Programming
In programming, parameters are variables or values passed to a function or method during its invocation. They enable the function to receive input data, perform operations, and optionally return a result.