SHARE
TWEET

Untitled

a guest May 19th, 2017 42 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
Want to get better at C++?
Learn to code C++ in 2017
Top