\"The greatest common divisor of two integers is the largest integer that evenly divides each of the two numbers. Write method Gcd that returns the greatest common divisor o
Using LINQ's Aggregate method:
static int GCD(int[] numbers) { return numbers.Aggregate(GCD); } static int GCD(int a, int b) { return b == 0 ? a : GCD(b, a % b); }
Note: answer above borrowed from accepted answer to Greatest Common Divisor from a set of more than 2 integers.