How exactly functions wrok? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How exactly functions wrok?

20th Mar 2018, 7:02 PM
Abhijnana Hk
Abhijnana Hk - avatar
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.
20th Mar 2018, 7:13 PM
Nilesh
Nilesh - avatar
+ 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.
20th Mar 2018, 7:20 PM
Tomer Sim
Tomer Sim - avatar
20th Mar 2018, 7:08 PM
Aaron Eberhardt
Aaron Eberhardt - avatar