Advertisement
Domerk

8/10/11 (Функция sum)

Oct 8th, 2011
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.26 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int sum (int a, int b)
  5. {
  6. int r;
  7. r = a+b;
  8. return r;
  9. }
  10.  
  11. int main ()
  12. {
  13. int x, y, z;
  14. cout<<"Donnez 2 numeros ";
  15. cin>>x>>y;
  16. z = sum (x, y);
  17. cout<<x<<"+"<<y<<"="<<z;
  18. cin.sync ();
  19. cin.get ();
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement