gcd = function(a, b) while b temp = b b = a % b a = temp end while return abs(a) end function print gcd(18,12)