Function - segment of code that is ran whenever the function is called. Functions exist outside of the main body of code, but can be called multiple times. Functions can also take in values / variables, which will often yield different outputs or returns from the function.
Void function - a function with no return statement. Although, multiple values can be retained by using pointers in parameters.
Value-returning function - a function that returns a value when it's finished.
See example below.
John B. Coleman Library |
Library Hours
|