A subroutine is a small section of program which can be 'called' (run) from anywhere else in the program...and as
many times as necessary.
There are two types of subroutine (in
Pascal)....
- Procedures - which perform a specific task..eg draw a
box on screen
- Functions - which return an answer...eg a
mathematical calculation
Every subroutine has a name.
The subroutine can be called by using its name.
|