Jump to content

Greatest common divisor: Difference between revisions

(Added iterative version)
Line 1,664:
=={{header|K}}==
<lang K>gcd:{:[~x;y;_f[y;x!y]]}</lang>
 
=={{header|Kotlin}}==
Recursive one line solution:
<lang kotlin>fun gcd(a: Int, b: Int): Int = if (b == 0) a else gcd(b, a % b)</lang>
 
=={{header|LabVIEW}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.