Subroutines

2021-03-15
1 min read

A subroutine is a named block of code that performs a specific task within a program.

Most high-level languages support two types of subroutine, functions and procedures, which are called in a slightly different way. The procedures will not return a value and a function will return a value.

int function()
{
    // Do something
    return 1;
}
void procedure()
{
    // Do something
    return;
}