Loops/For with a specified step: Difference between revisions

Content added Content deleted
(Added Delphi example)
(→‎{{header|PARI/GP}}: demonstrate further)
Line 482: Line 482:
=={{header|PARI/GP}}==
=={{header|PARI/GP}}==
<lang parigp>forstep(n=1,10,2,print(n))</lang>
<lang parigp>forstep(n=1,10,2,print(n))</lang>

The <code>forstep</code> construct is actually more powerful. For example, to print numbers with last digit relatively prime to 10:
<lang parigp>forstep(n=1,100,[2,4,2,2],print(n))</lang>


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