Greatest common divisor: Difference between revisions

+ Pascal
(→‎{{header|Nial}}: It is a shame to use variables in such a beautiful language.)
(+ Pascal)
Line 315:
else if a > b then gcd b (a mod b)
else gcd a (b mod a)
 
=={{header|Pascal}}==
<pascal>
function gcd(a, b: integer): integer;
var
tmp: integer;
begin
while b <> 0 do
begin
tmp := a mod b;
a := b;
b := tmp
end;
gcd := a
end;
</pascal>
 
=={{header|Perl}}==
973

edits