Loops/For with a specified step: Difference between revisions
Content added Content deleted
(adding gap) |
m (→{{header|GAP}}) |
||
Line 425: | Line 425: | ||
=={{header|GAP}}== |
=={{header|GAP}}== |
||
# Use a range [a, b .. c], where the step is b-a (b is the value following a), and c-a must be a multiple of the step |
# Use a range [a, b .. c], where the step is b-a (b is the value following a), and c-a must be a multiple of the step. |
||
<lang gap>for i in [1, 3 .. 11] do |
<lang gap>for i in [1, 3 .. 11] do |
||
Print(i, "\n"); |
Print(i, "\n"); |