RosettaCodeData/Task/Greatest-common-divisor/Liberty-BASIC/greatest-common-divisor.basic
2023-07-01 13:44:08 -04:00

12 lines
167 B
Text

'iterative Euclid algorithm
print GCD(-2,16)
end
function GCD(a,b)
while b
c = a
a = b
b = c mod b
wend
GCD = abs(a)
end function