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.
 
 
 
 
 
 

19 lines
359 B

  1. 5 REM find greatest common divisor (Euclidean Algorithm)
  2. 10 CALL SHELL("cls")
  3. 20 LET A = 1071
  4. : LET B = 462
  5. 30 IF A < B THEN
  6. : C = A
  7. : A=B
  8. : B=C
  9. : END IF
  10. 40 PRINT A,B
  11. 50 LET C = A - INT(A/B)*B
  12. : REM C = A MOD B (A modulo B)
  13. 60 LET A = B
  14. : B = C
  15. 70 IF B > 0 GOTO 40
  16. 80 PRINT "GCG is ";A
  17. 90 END