Greatest common divisor: Difference between revisions

m
No edit summary
Line 893:
=={{header|Elena}}==
{{trans|C#}}
ELENA 3.34 :
<lang elena>import system'math.
import extensions.
 
gcd = (:a:,b)
[
var $ai := a.
var $bj := b.
while($bj != 0)
[
var tmp := $ai.
$ai := $bj.
$bj := tmp mod($bj).
].
^ $a.i
].
 
printGCD = (:a:,b)
[
console printLineFormatted("GCD of {0} and {1} is {2}", a, b, gcd(a,b)).
].
 
programpublic =program
[
printGCD(1,1).
Line 927:
printGCD(36,19).
printGCD(36,33).
].</lang>
{{out}}
<pre>
Anonymous user