Subroutine

In computer programming, a subroutine (also called procedure, function, or method) is code that is grouped together to do specific tasks. The purpose is to perform a series of instructions to complete the task. Subroutines are smaller groups of a larger program, that can have many subroutines. They can be re-used by other programs and programmers, hence saving time and helping to be organized.

Subroutines are commonly paired with parameters, a type of variable used as input. After changes are made by the code, there will be a result, that completes the task.

Category:Computer programming