Functions
Functions
Syntax
Example
1. Library Function
Advantages of Functions in C
Functions in C is a highly useful feature of C with many advantages as
mentioned below:
1. The function can reduce the repetition of the same statements in the
program.
2. The function makes code readable by providing modularity to our
program.
3. There is no fixed number of calling functions it can be called as
many times as you want.
4. The function reduces the size of the program.
5. Once the function is declared you can just use it without thinking
about the internal working of the function.
Disadvantages of Functions in C
The following are the major disadvantages of functions in C:
1. Cannot return multiple values.
2. Memory and time overhead due to stack frame allocation and transfer
of program control.