Functions
Beginner · Fundamentals
Learn how to write reusable and meaningful code by using functions.
Exercises
Section titled “Exercises”functions1 compile
Section titled “functions1 compile”Define the function that main calls.
Show hint
The main function is calling another function that it expects to exist.It expects a function named `call_me` to exist and receive no arguments.functions2 compile
Section titled “functions2 compile”Function parameters must declare their types.
Show hint
Function parameters need to have their types explicitly declared.functions3 compile
Section titled “functions3 compile”Call a function with the argument it expects.
Show hint
When a function expects arguments, you must pass values to them.functions4 compile
Section titled “functions4 compile”A function returning a value must declare its return type.
Show hint
Functions that return values must have return types declared in the function signature.