Functions and procedures
Functions and procedures
A subroutine is a named block of code that you can call from somewhere else in the program. Subroutines support decomposition because a large task is split into smaller parts that are easier to test, reuse and fix.