ChipMaster's bwBASIC This also includes history going back to v2.10. *WARN* some binary files might have been corrupted by CRLF.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

sumintexit.bas 334 B

1234567891011121314
  1. 10 REM compute the sum of integers with FOR loop. Early exit.
  2. 20 CALL SHELL("cls")
  3. 30 FOR N=1 TO 10
  4. 35 IF (S + N > 25) GOTO 80
  5. : REM exit the loop when S gets large enough
  6. 40 LET S = S + N
  7. 50 PRINT N,S
  8. 70 NEXT N
  9. 80 PRINT
  10. : REM print empty line
  11. 90 PRINT "Final sum:";S
  12. 95 PRINT
  13. 100 END