Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int sum (int x, int y){
  5.  
  6. int z;
  7. z = x + y;
  8. return (z);
  9.  
  10. }
  11.  
  12. int main()
  13. {
  14. int a, b, result;
  15. cout << "enter two numbers: " << endl;
  16. cin >> a;
  17. cin.ignore();
  18. cin >> b;
  19. cin.ignore();
  20.  
  21. result = sum(a,b);
  22.  
  23. cout << "the result of " << a << " + " << b << " is " << result;
  24.  
  25. cin.ignore();
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement