Advertisements
Advertisements
Question
What are the advantages of defining a method in a program?
Answer in Brief
Solution
The advantages of defining a method in a program are as follows:
- Because the same program segment can be used repeatedly by changing the input values to achieve the desired outputs, it promotes reusability and shortens the program's duration.
- It decreases the amount of memory.
- Because the program is relatively shorter, it also makes debugging easier.
shaalaa.com
Is there an error in this question or solution?
Chapter 5: User - Defined Methods - EXERCISES [Page 337]