fork download
  1. #include <iostream>
  2. using namespace std;
  3. void showVar(); // Function prototype
  4. int main()
  5. { for (int count = 0; count < 10; count++)
  6. showVar();
  7. return 0;
  8. }
  9. // Definition of function showVar
  10. void showVar()
  11. { static int var = 10;
  12. cout << var << endl;
  13. var++;
  14. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
10
11
12
13
14
15
16
17
18
19