Loops/For with a specified step: Difference between revisions

Content added Content deleted
(Zig version with for-loop added)
(PascalABC.NET)
Line 2,217: Line 2,217:
=={{header|Pascal}}==
=={{header|Pascal}}==
See [[Loops/For_with_a_specified_step#Delphi | Delphi]]
See [[Loops/For_with_a_specified_step#Delphi | Delphi]]

=={{header|PascalABC.NET}}==
<syntaxhighlight lang="delphi">
begin
for var i:=1 to 10 step 2 do
Print(i);
Println;
for var i:=20 to 1 step -3 do
Print(i);
end.
</syntaxhighlight>
{{out}}
<pre>
1 3 5 7 9
20 17 14 11 8 5 2
</pre>



=={{header|Perl}}==
=={{header|Perl}}==