First page Back Continue Last page Graphics
Function Declaration
A function is declared to the computer using the following syntax:
- return_variable name( input variables ) { commands }
- name : can be any text without numbers or symbols, as long as it is not used already
- input_variables : inputs, if we want them
- return_variable : output value, if we want one
- commands : lines of code to execute when we call the function
- we can have as many inputs as we want, but only one return var
- if we don't want input or return variables we use void