[PHP] Highest common factor's function (HCF)

Highest common factor's function
language use => php
 function gcd($a ,$b){
while ($b != 0){
$r = $a % $b;
$a = $b;
$b = $r;
}
return $a;
}
print gcd($a,$b);

Post by wiki

沒有留言:

發佈留言