Loops/While: Difference between revisions

Content added Content deleted
Line 519: Line 519:
ENDWHILE
ENDWHILE
'Output starts with 512 and ends with 0.
'Output starts with 512 and ends with 0.

'Putting the following in the loop will produce output starting with 1024 and ending with 1:
'PRINT X
'X=X/2

PRINT:PRINT"Press any key to end."


'Keep the console from closing right away so the figures can be read.
'Keep the console from closing right away so the figures can be read.