0

Why do we need to return function's value??

28th May 2017, 3:45 PM
Raj Kc
Raj Kc - avatar
3 Answers
+ 11
Functions return a value (except for functions declared with "void" keyword), the "return" allows you to close the function and return the value. More informations - https://stackoverflow.com/questions/16706813/when-return-is-needed-and-not-needed-in-c Similar threads - https://www.sololearn.com/Discuss/55719/?ref=app https://www.sololearn.com/Discuss/239950/?ref=app
28th May 2017, 3:51 PM
Maz
Maz - avatar
+ 4
because we need some value from calculation done in function. let say function Velocity where it take two integer as argument (space and time) and return double ( because many velocity is in decimal number). Thus the function Velocity return double.
28th May 2017, 3:50 PM
Setiawan Next
Setiawan Next - avatar
0
Try to make some programs to solve specific problems and you will realize why returning a value is important and beneficial
28th May 2017, 4:01 PM
Gagan Deep
Gagan Deep - avatar