CPP   68

reference

Guest on 20th April 2022 02:11:20 AM

  1. #include <iostream>
  2. using namespace std;
  3.  
  4. // Global
  5. int count=0;
  6.  
  7. void increment(int &);
  8.  
  9. int main() {
  10.     int i=5;
  11.     i++;
  12.  
  13.     count++;
  14.     increment(i);
  15.     cout << i << endl;
  16.     cout << "count: " << count <<endl;
  17.     return 0;
  18. }
  19.  
  20. void increment(int &n) {
  21.     count++;
  22.     cout << "n: " << n << endl;
  23.     n++;
  24. }

Raw Paste


Login or Register to edit or fork this paste. It's free.