Loops/For with a specified step: Difference between revisions

m
demonstrating decrementing with step
m (→‎{{header|AppleScript|}}: Tweak irregular header markup)
m (demonstrating decrementing with step)
Line 701:
 
==={{header|QB64}}===
<lang QB64Qbasic>For i% = 0 to 10 Step 2
Print i%
Next 'To be more explicit use "Next i%"
Line 714:
8
10
</pre>
 
We can also decrement with stepping
<lang Qbasic>For i% = 10 to 0 Step -2
Print i%
Next i
</lang>
{{out}}
 
<pre>
10
8
6
4
2
9
</pre>
 
57

edits