OUTPUT (after running):
Enter names one per line
Terminate with string END
Krish Rajiv Ajay Mayur Diksha
Total names = 5
Sorted Names:
Ajay Diksha Krish Mayur Rajiv
3.2 THE CONCEPT OF SUBPROGRAMMING
When a problem to be solved is very complex, we first need to divide that complex problem into
smaller, simpler problems. Then we try to find the subsolutions to these subproblems. Finally, we
integrate (combine) all these subsolutions to get a complete solution.
This approach is called the
modular approach and such programming is called modular programming.
An advantage here is
that parallel coding can be done for these modules. A library of modules may be created and these
may be reused when needed by another program and called by the user. They behave like inbuilt
modules. Debugging and maintenance of modules is simpler than ever, as module sizes are usually
small. Bigger programs, called monolithic programs, should therefore be avoided.
Do'stlaringiz bilan baham: |