Skip to content

Commit

Permalink
gcd added
Browse files Browse the repository at this point in the history
  • Loading branch information
smalam119 committed Apr 19, 2018
1 parent 1c1d485 commit 60a886d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ProblemSolving/GCD.swift
@@ -0,0 +1,13 @@
//Sayed Mahmudul Alam
//Greatest Common Divisor

struct GCD {
func getGCD(a: Int, b: Int) -> Int {
let r = a % b
if r != 0 {
return getGCD(a: b, b: r)
} else {
return b
}
}
}

0 comments on commit 60a886d

Please sign in to comment.