Advertisement
MeehoweCK

Untitled

Mar 16th, 2023
300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. // UWAGA: funkcja nie modyfikuje zmiennej przekazywanej do funkcji!
  6. // funkcja pobiera wartość zmiennej, a nie samą zmienną!
  7.  
  8. void wypisz(int liczba)
  9. {
  10.     cout << liczba << endl;     // 2. 10
  11.     ++liczba;
  12.     cout << liczba << endl;     // 3. 11
  13. }
  14.  
  15. int main()
  16. {
  17.     int liczba = 10;
  18.     cout << liczba << endl;     // 1. 10
  19.     wypisz(liczba);
  20.     cout << liczba << endl;     // 4. 10
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement