Functions
- Functions
- Branches off from program to function and then returns to program
- Functions either return a value or nothing (void)
- Parts of a function
- header return type functionname(type parameter1. type parameter2, etc.)
- return type
- function name
- parameters
- a declaration of what type of value will be passed into the function
- the actual values passed into the calling function are arguments
- function signature - the name of the function and its parameters
- body
- { opening brace
- statements
- return - returns a value
- } closing brace
Back to the Main Menu