Advertisement
MeehoweCK

Untitled

Apr 16th, 2021
785
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. /* FUNKCJA - składnia
  6.  
  7. typ_zwracany nazwa_funkcji([argumenty_wejściowe])
  8. {
  9.     ciało_funkcji
  10. }
  11.  
  12. */
  13.  
  14. int suma(int a, int b)
  15. {
  16.     return a + b;
  17. }
  18.  
  19.  
  20. int main()
  21. {
  22.     cout << suma(3, 8) << endl;
  23.     cout << suma(100, 20) << endl;
  24.  
  25.     int liczba1, liczba2;
  26.     cin >> liczba1 >> liczba2;
  27.     cout << suma(liczba1, liczba2) << endl;
  28.  
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement