fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int i;
  8.  
  9. cout << "I am going to list numbers now:" << endl;
  10.  
  11. // for loop allows us to initialize variable,
  12. // specify the condition, and also the way the
  13. // variable changes in each iteration of the loop
  14.  
  15. for (i=0; i<42; i=i+1)
  16. cout << i << endl;
  17.  
  18. return 0;
  19. }
Success #stdin #stdout 0.01s 2680KB
stdin
Standard input is empty
stdout
I am going to list numbers now:
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41