Functions - Defining A Function
Introduction
Functions are reusable blocks of code that can be called from other parts of your program. They can take inputs (parameters) and can return outputs. Functions help make your code more organized, modular, and easier to read and maintain.
Defining a Function
To define a function, you need 3 things (in this order):
- A return type, or void if the function doesn't return anything.
- A name for the function that will be used to call it.
- Any parameters, or inputs (there might be none).
Great! We just defined our function. Now, how do we use it?
ByteBrawl
0