Why typically a long program is divided into smaller functions or procedures?
Answers
Answered by
37
Answer:
There are a few potential benefits to breaking big functions up in to smaller functions. Often in large functions you have to do more-or-less the same thing many times. By generalizing this in to a single common function, you can use that one block of code in multiple places.
Answered by
16
A long program is divided into smaller functions or procedures so that it becomes easy to understand.
- If a program is divided into smaller parts then it allows to test a part of the program individually without testing the whole program again and again.
- It makes easier for the programmer to understand the program.
- It becomes much easier to detect error in a program.
- It is easier to write a program in this manner.
Similar questions