Template:Computer Programming/Control/12

for loop on arrays
Another very common situation is the need for a loop which iterates over every element of an array. The following sample code shows you how to achieve this: