- A value-returning function is a program routine called for its return value and is therefore similar to a mathematical function.
Example
- Function name: avg
- Takes three arguments: n1, n2, and n3
- Calculates and returns the average of the three arguments.
- Function call example: avg(10, 25, 16) evaluates to the calculated average.
- Return statement: return expr where expr is the expression that holds the result.
![](https://bscbcanotes.wordpress.com/wp-content/uploads/2024/05/image-54.png?w=1024)