This refers to a mini program that resides inside another program and is called within that program. Typically, you put together a subroutine when you have to do similar repetitive tasks in different areas of your program and you don't want to code the same thing over and over again.
the smallest unit of program source code which can be invoked at program execution time by other subroutines (within the same module or other modules) to perform tasks. Its attributes include: it may or may not be re-usable or re-entrant to itself (it should have only one entry point); it is not compilable by itself; it is language dependant and can call or be called (by other subroutines). Depending on program language used, a subroutine may be referred to as a "function" or a "section."
A group or sequence of instructions for a specific programming task that is called by another program.