Hi, I was trying to write an alogorithm so it could find the GCF(Greatest Common Factor) of two numbers, and someone gave me a function along with some other code. but my question is how this function works, if anyone could explain it step by step what is doing that would be great.
VB.NET:
Public Function GCD(a As Integer, b As Integer)
If b Then
GCD = GCD(b, a Mod b)
Else
GCD = a
End If
End Function