Using a for loop:
1
2
3
4
5
Using a foreach loop:
1
2
3
4
5
6

SUM: 21