Functions
Of the most known methods to solve a problem, is to divide it into
smaller problems, called subproblems. In this way, instead of
solving a complex and tedious task, we solve simpler ones and
from them we arrive at the solution. This technique is used a lot in
programming since programming is nothing more than solving
problems, and it is usually called descending design, divide and
conquer methodology or top-down programming.
It is clear that if this methodology leads us to deal with
subproblems, then we also need to be able to create and work
with subprograms to solve them. These subprograms are usually
called modules, hence the name of modular programming. In
Pascal we have two types of modules: procedures and functions.