A set of instructions that performs a specific task for a main routine, requiring direction back to the proper place in the main routine on completion of the task.
In closed subroutine a subroutine stored outside the main routine can be connected to it by linkages at one or more locations.whereas in open subroutine is a set of computer instructions i.e. a...
subroutines are used to make code appear easier to use because it isolates certain statements, which you can then invoke on demand by invoking the subroutine