0

why we use return

22nd Sep 2016, 9:53 AM
Muhammad Ali Hassan
Muhammad Ali Hassan - avatar
1 Answer
+ 1
Return is used for return a number from function. Example: int sum(int a, int b){ int result = a+b; return result; } int main(void){ cout << sum(1,9); } that should print 10
29th Sep 2016, 4:39 PM
Piotr
Piotr - avatar