Subroutine
From Coderwiki
More actions
A subroutine is a code block in a separate part of the source code.
This code block can be called, or 'invoked', and calling the subroutine will run the code in the code block.
Parameters
edit edit sourceSubroutines can take in parameters. These parameters give the subroutine more information about how to run and what values to act upon.
For example, a function addOne which simply returns the integer one above the value of the parameter we pass in, could take in an integer called num as a parameter.