Greatest common divisor: Difference between revisions

Improved example moved to main page
Tag: Manual revert
(Improved example moved to main page)
Line 1,545:
return gcdp( abs(a), abs(b) )
end function</syntaxhighlight>
 
==={{header|FutureBasic}}===
<syntaxhighlight lang="futurebasic">window 1, @"Greatest Common Divisor", (0,0,480,270)
 
local fn gcd( a as short, b as short ) as short
short result
if ( b != 0 )
result = fn gcd( b, a mod b)
else
result = abs(a)
end if
end fn = result
 
print fn gcd( 6, 9 )
 
HandleEvents</syntaxhighlight>
 
==={{header|GFA Basic}}===
715

edits