Advertisement
Guest User

Untitled

a guest
May 19th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int funkyshun(int& num1, int& num2, int& num3); // The function prototype goes here
  5.  
  6. int main()
  7. {
  8.     int num1, num2, num3, num4;
  9.  
  10.     cout << "Please enter three numbers" << endl;
  11.  
  12.     cin >> num1;
  13.     cin >> num2;
  14.     cin >> num3;
  15.  
  16.     num4 = funkyshun(num1, num2, num3); // Here we invoke the function
  17.  
  18.     cout << "The sum is " << num4 << endl << endl;
  19.  
  20.     return 0;
  21. }
  22.  
  23. int funkyshun(int& num1, int& num2, int& num3) // And here is the function definition
  24. {
  25.     int sum;
  26.  
  27.     sum = num1 + num2 + num3;
  28.  
  29.     return sum;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement