What are the advantages of defining a method in a program
Answers
Answered by
2
Answer:
ADVANTAGES OF USING A FUNCTION
Here are several advantages of using functions in your code:
- Use of functions enhances the readability of a program. A big code is always difficult to read. Breaking the code in smaller Functions keeps the program organized, easy to understand and makes it reusable.
- The C compiler follows top-to-down execution, so the control flow can be easily managed in case of functions. The control will always come back to the main() function.
- It reduces the complexity of a program and gives it a modular structure.
- In case we need to test only a particular part of the program we will have to run the whole program and figure out the errors which can be quite a complex process. Another advantage here is that functions can be individually tested which is more convenient than the above mentioned process.
- A function can be used to create our own header file which can be used in any number of programs i.e. the reusability.
Explanation:
Answered by
4
Please mark it as brainliest.
Attachments:
Similar questions