Skip to content

Latest commit

 

History

History
21 lines (15 loc) · 320 Bytes

euclidean-algorithm.md

File metadata and controls

21 lines (15 loc) · 320 Bytes

Euclidean Algorithm

Back{: .button}

Euclidean Algorithm is used to calculate the gcd of two numbers x, y

Example

int gcd(int x, int y) {
    while(y !=0)
        t = y
        y = x % y
        x = t
    return x
}

See Also