+ 2
How exactly functions wrok?
4 Answers
+ 5
The name function comes from functionality.
A function is like a closed box. Inside of the box there is a mechanism that performs some action. This action is programmed by the creator of the function. If you are the programmer you create the functionality inside of it.
So in a way, functions are like memory blocks used to save a mini program inside them.
A function has an input we call parameters, the body of the function does the magic stuff, and then it outputs a result.
+ 3
Functions in programming are exactly the same as in math. You enter a value.
and the function returns a value.
Just like you can change f(x) = ??????????
you can change functions in programming to get different outputs.