Introduction to Functions in C
A function is a block containing a number of statements, which perform a specific and well defined task(s). Every function has a unique name which is sued to identify it in a program. Once a task is packaged in a function, it can be called from any where in a program through other statements.
- Function reduce the complexity of program by dividing the into smaller modules, thus making them easier to read and debug.
- Function enhance reusability of code and can be called from any where in a program and any number of time.
- Function are useful in hiding the implementation details.
- It is easier to edit a program, which is written using methods. While working on one function, one can focus on just that part of the program by debugging, constructing and making it perfect.