Abc.NCrafts.Quizz.Performance.Questions._026.Answer2.GreatestCommonDivisor C# (CSharp) Method

GreatestCommonDivisor() private static method

private static GreatestCommonDivisor ( int a, int b ) : int
a int
b int
return int
        private static int GreatestCommonDivisor(int a, int b)
        {
            while (b != 0)
            {
                var tmp = b;
                b = a % b;
                a = tmp;
            }
            return a;
        }
    }