- A function call is very important in programming.
- When we need to call a function, it is called inside a program.
- A function which is being called by the parent functions is known as called functions
- Function which is being called is known as calling function.
- A function is called by the program whenever it is needed.
- Functions are called by its name in the main program.
- We can pass parameters to the functions that are being called in the main function.
Syntax
Calling a function in C program
Add.c
Output
Call by value
- When an single or multiple values of an argument are copied into formal parameters of a function, this type of functions is known as Call By Value.
- It does not change the value of the function`s actual parameter.
Call by Value in C programming
Call_Value.c
Output
Call By Reference
- As name suggests call by reference is a method, where the address of the actual argument is copied into the function call’s formal parameter.
- This type of method is known as Call by Reference.
- If we make some changes in the formal parameters, it shows the effect in the value of the actual parameter.
Call by Reference in C programming
Call_Ref.c
Output