Advertisement
Da_Gamer

Function Example 4

Dec 19th, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdlib.h>
  3.  
  4. using namespace std;
  5.  
  6. int returnFive()
  7. {
  8.     int five = 5;
  9.     return five;
  10. }
  11.  
  12. int returnFiveDoubled(int value)
  13. {
  14.     return value * 2;
  15. }
  16. int main()
  17. {
  18.     int newValue = returnFive();
  19.     int doubledValue = returnFiveDoubled(newValue);
  20.     cout << doubledValue << endl;
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement