Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int funkyshun(int& num1, int& num2, int& num3); // The function prototype goes here
- int main()
- {
- int num1, num2, num3, num4;
- cout << "Please enter three numbers" << endl;
- cin >> num1;
- cin >> num2;
- cin >> num3;
- num4 = funkyshun(num1, num2, num3); // Here we invoke the function
- cout << "The sum is " << num4 << endl << endl;
- return 0;
- }
- int funkyshun(int& num1, int& num2, int& num3) // And here is the function definition
- {
- int sum;
- sum = num1 + num2 + num3;
- return sum;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement