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 thisNum1, int thisNum2, int thisNum3); // The function prototype goes here
  5.  
  6. class holo_room
  7. {
  8. public:
  9.     int test;
  10. private:
  11.     int sum;
  12. };
  13.  
  14. int main()
  15. {
  16.     int num1, num2, num3, num4;
  17.  
  18.     cout << "Please enter three numbers" << endl;
  19.  
  20.     cin >> num1;
  21.     cin >> num2;
  22.     cin >> num3;
  23.  
  24.     num4 = funkyshun(num1, num2, num3); // Here we invoke the function
  25.  
  26.     cout << "The sum is " << num4 << endl << endl;
  27.  
  28.     return 0;
  29. }
  30.  
  31. int funkyshun(int thisNum1, int thisNum2, int thisNum3) // And here is the function definition
  32. {
  33.     sum = thisNum1 + thisNum2 + thisNum3;
  34.  
  35.     return sum;
  36. }
RAW Paste Data
Want to get better at C++?
Learn to code C++ in 2017
Top