Explore
Connect
Documentation
Snippets
Log in
Sign up
Computing with Data
elgeish
180.9K views
Forking
Fork
GitHub
Open Source Your Knowledge, Become a Contributor
Technology knowledge has to be shared and made accessible for free. Join the movement.
Create Content
62/300
For-Loops - Part I
Previous:
While-Loops
Next:
For-Loops - Part II
For-Loops - Part I
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include
<iostream>
using
namespace
std
;
int
main
(
)
{
int
an_array
[
10
]
;
int
i
;
// initialize an_array to hold 0, 1, ..., 9
// 10 iterations are executed, corresponding to
// i = 0, 1, ..., 9
for
(
i
=
0
;
i
<
10
;
++
i
)
{
an_array
[
i
]
=
i
;
}
// print the values of the array on a single line
for
(
i
=
0
;
i
<
10
;
++
i
)
{
cout
<<
an_array
[
i
]
<<
' '
;
}
cout
<<
endl
;
return
0
;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Run
34
2
Suggested playgrounds
Recueil d'exercices pour apprendre Python au lycée
By
M_C
299.4K
156
44
Java Interview Questions and Programming Examples
By
[CG]OlogN
72.4K
45
12
How to build a chatbot in less than 50 lines of code
By
[CG]Maxime
15.6K
73
4
SYCL Docker
By
olivatooo
1,416
2
0
Open Source Your Knowledge: become a Contributor and help others learn.
Create New Content