92,703 views
29 votes
29 votes
What is a fruitful function? Explain with help of programming example?
plz

User Cajunluke
by
2.2k points

1 Answer

15 votes
15 votes
These are the functions that return a value after their completion. A fruitful function must always return a value to where it is called from. A fruitful function can return any type of value may it be string, integer, boolean, etc. It is not necessary for a fruitful function to return the value of one variable, the value to be returned can be an array or a vector. A fruitful function can also return multiple values.
User Richard Peck
by
2.9k points