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.
 
 
 
 
 
 

15 lines
376 B

  1. 5 REM input a number, output its binary representation
  2. 10 CALL SHELL("cls")
  3. 50 INPUT "Enter an integer greater than zero : ";A
  4. 60 IF (A < 0 OR A<>INT(A)) GOTO 50
  5. 65 IF (A = 0) GOTO 140
  6. 70 LET B = A - INT (A/2) * 2
  7. 90 LET X$ = STR$(B) + X$
  8. 110 LET A = (A - B) / 2
  9. 120 IF (A > 0) GOTO 70
  10. 125 PRINT
  11. 130 PRINT "As binary: ";X$
  12. 135 PRINT
  13. 140 END