Skip to content

Commit 7cdd68f

Browse files
authored
Merge pull request #26 from MHMITHUN/patch-2
Array00.cpp
2 parents deb0998 + 96f1f43 commit 7cdd68f

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

Array00.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#include <iostream>
2+
using namespace std;
3+
4+
int main() {
5+
6+
int numbers[5] = {7, 5, 6, 12, 35};
7+
8+
cout << "The numbers are: ";
9+
10+
// Printing array elements
11+
// using range based for loop
12+
for (const int &n : numbers) {
13+
cout << n << " ";
14+
}
15+
16+
cout << "\nThe numbers are: ";
17+
18+
// Printing array elements
19+
// using traditional for loop
20+
for (int i = 0; i < 5; ++i) {
21+
cout << numbers[i] << " ";
22+
}
23+
24+
return 0;
25+
}

0 commit comments

Comments
 (0)