Jump to content

Greatest common divisor: Difference between revisions

add gw basic
(add gw basic)
Line 2,083:
gcd(800, 70) = 10 == 10
gcd(27, -70) = 1 == 1</pre>
 
=={{header|GW-BASIC}}==
<lang gwbasic>10 INPUT A, B
20 IF A < 0 THEN A = -A
30 IF B < 0 THEN B = -B
40 GOTO 70
50 PRINT A
60 END
70 IF B = 0 THEN GOTO 50
80 TEMP = B
90 B = A MOD TEMP
100 A = TEMP
110 GOTO 70</lang>
 
=={{header|Haskell}}==
781

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.