Exercise 03: Greatest Common Divisor
Date completed: 11/08/2019
The greatest common divisor of integers x and y is the largest integer that evenly divides into both x and y. Write a recursive method gcd that returns the greatest common divisor of x and y. The gcd of x and y is defined recursively as follows: If y is equal to 0, then gcd( x, y ) is x; otherwise, gcd( x, y ) is gcd( y, x % y ), where % is the remainder operator.
The Created Code
The source code can be found here. It has been compressed in to a 7-Zip file.