Advertisement
jerimin

Function Prototyping

Oct 31st, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. //Function Prototyping
  2. #include<iostream>
  3. using namespace std;
  4.  
  5. int sum(int num1, int num2);
  6. double sum(double num1, double num2);
  7.  
  8. int main()
  9. {
  10.     //var
  11.     //code
  12.     cout << "This should be an integer ----> "<< sum(1, 2) << endl;
  13.     cout << "This should be a double number ----> " << sum(2.34, 3.56) << endl;
  14.     return 0;
  15. }
  16.  
  17. int sum(int num1, int num2)
  18. {
  19.     int summ = num1 + num2;
  20.  
  21.     return summ;
  22. }
  23.  
  24. double sum(double num1, double num2)
  25. {
  26.     double summ = num1 + num2;
  27.  
  28.     return summ;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement