Need for Functions
To reduce size and complexity of the program we use Functions. The programmers can make use of sub programs either writing their own functions or calling them from standard library.
• Complicated programs can be divided into manageable sub programs called functions.
• A programmer can focus on developing, debugging and testing individual functions.
• Many programmers can work on different functions simultaneously.
• Few lines of code may be repeatedly used in different contexts. Duplication of the same code can be eliminated by using functions which improves the maintenance and reduce program size.
• Some functions can be called multiple times with different inputs.