home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / simtel / cpmug / cpmug003.ark / EUCLID.BAS < prev    next >
Encoding:
BASIC Source File  |  1984-04-29  |  402 b   |  13 lines

  1. REM             Program EUCLID
  2. REM             Greatest Common Factor of 2 Nos.
  3. 10       Input "2 Integers";N,D
  4.          If N eq 0 then STOP
  5. 20       Remainder=N-D*INT(N/D)
  6.          If Remainder eq 0 then 30
  7.          N=D
  8.          D=Remainder
  9.          go to 20        REM loop until zero
  10. 30       print:print "G.C.F. is ";D
  11.          print:print
  12.          go to 10        REM try another pair
  13.