Loops/Foreach: Difference between revisions
Added C3 code.
(Added C3 code.) |
|||
Line 880:
element += 42;
}</syntaxhighlight>
=={{header|C3}}==
C3 has a standard built-in foreach for iterating through lists.
<syntaxhighlight lang="c3">String[] fruits = { "Apple", "Banana", "Strawberry" };
foreach (fruit : fruits) io::printn(fruit);</syntaxhighlight>
=={{header|Chapel}}==
|