GCD (Euclid)
Go Algorithms
while + swap
Flowchart (ISO 5807)
Source code
func gcd(a, b int) int {
for b != 0 {
a, b = b, a%b
}
return a
} while + swap
func gcd(a, b int) int {
for b != 0 {
a, b = b, a%b
}
return a
}