MeehoweCK

Untitled

Oct 16th, 2020
628
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.45 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int funkcja(int &x)
  6. {
  7.     cout << x << endl;              // 2. 10
  8.     ++x;
  9.     cout << x << endl;              // 3. 11
  10.     x *= 10;
  11.     cout << x << endl;              // 4. 110
  12.     return x;                       // 5. 110
  13. }
  14.  
  15. int main()
  16. {
  17.     int x = 10;
  18.     cout << x << endl;              // 1. 10
  19.     cout << funkcja(x) << endl;
  20.     cout << x << endl;              // 6. 110
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment