Loops/Do-while: Difference between revisions

Content deleted Content added
m →‎{{header|Microsoft Small Basic}}: "Each time through the loop, add 1 to the value _then_ print it."
m →‎{{header|GW-BASIC}}: "Each time through the loop, add 1 to the value _then_ print it."
Line 1,276:
Equivalent using <code>WHILE</code>:
{{works with|PC-BASIC|any}}
<lang qbasicgwbasic>
10 LET I% = 0
20 ' first iteration - before the WHILE
30 PRINTLET I% = I% + 1
40 LETPRINT I% = I% + 1
50 WHILE I% MOD 6 <> 0
60 PRINTLET I% = I% + 1
70 LETPRINT I% = I% + 1
80 WEND
</lang>
Equivalent using <code>GOTO</code>:
{{works with|PC-BASIC|any}}
<lang qbasicgwbasic>
10 LET I% = 0
20 PRINTLET I% = I% + 1
30 LETPRINT I% = I% + 1
40 IF I% MOD 6 <> 0 THEN GOTO 20
</lang>