Greatest common divisor: Difference between revisions

Content added Content deleted
imported>Szymon-Michalak
Line 2,620: Line 2,620:


<syntaxhighlight lang="text">
<syntaxhighlight lang="text">
proc gcd a b . res .
func gcd a b .
while b <> 0
while b <> 0
h = b
h = b
b = a mod b
b = a mod b
a = h
a = h
.
.
res = a
return a
.
.
call gcd 120 35 r
print gcd 120 35
print r
</syntaxhighlight>
</syntaxhighlight>