Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. /* Michael Kemper
  2. ID: 0506582
  3. October 24th, 2016
  4. This is journal 5C
  5. This adds up numbers.*/
  6. #include <iostream>
  7.  
  8. using namespace std;
  9.  
  10. int sumInt(int a, int b);
  11. int sumInt(int a, int b, int c);
  12.  
  13. int main()
  14. {
  15. cout << "Enter three numbers and I will sum them " << endl;
  16. int x, y, z;
  17. cin >> x >> y >> z;
  18. int mySum = sumInt(x, y, z);
  19. cout << "The sum of your numbers is " << mySum << endl;
  20.  
  21. return 0;
  22. }
  23.  
  24. int sumInt(int a, int b) {
  25. return a + b;
  26. }
  27.  
  28. int sumInt(int a, int b, int c, int d) {
  29. int theSum = sumInt(a, b);
  30. int theSum2 = sumInt(theSum, c);
  31. return sumInt(theSum2,d);
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement