10 PRINT "GREATEST COMMON DENOMINATOR"
20 PRINT
30 PRINT "(ENTER 0,0 TO END PROGRAM)"
40 PRINT "ENTER TWO NUMBERS";
50 INPUT A,B
59 REM - END PROGRAM?
60 IF A<>0 THEN 90
70 IF B<>0 THEN 90
80 GOTO 190
89 REM - CALCULATE GCD ACCORDING TO EUCLIDEAN ALGORITHM, PRINT RESULT
90 A=ABS(A)
100 B=ABS(B)
110 R=A-B*INT(A/B)
120 IF R=0 THEN 160
130 A=B
140 B=R
150 GOTO 110
160 PRINT "G.C.D:";B
169 REM - PRINT BLANK LINE TO SEPARATE SETS OF DATA
170 PRINT
179 REM - RESTART PROGRAM
180 GOTO 40
190 END
