Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Michael Kemper
- ID: 0506582
- October 24th, 2016
- This is journal 5C
- This adds up numbers.*/
- #include <iostream>
- using namespace std;
- int sumInt(int a, int b);
- int sumInt(int a, int b, int c);
- int main()
- {
- cout << "Enter three numbers and I will sum them " << endl;
- int x, y, z;
- cin >> x >> y >> z;
- int mySum = sumInt(x, y, z);
- cout << "The sum of your numbers is " << mySum << endl;
- return 0;
- }
- int sumInt(int a, int b) {
- return a + b;
- }
- int sumInt(int a, int b, int c, int d) {
- int theSum = sumInt(a, b);
- int theSum2 = sumInt(theSum, c);
- return sumInt(theSum2,d);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement