Greatest Common Divisor. Given two integers x and y, the following recursive definition determines the greatest common divisor of x and y, written gcd(x,y):
(Note: In this definition, % is the mod operator.)
(This algorithm to determine the gcd of two integers is called the Euclidean algorithm.) Write a recursive method, gcd, that takes as parameters two integers and returns the greatest common divisor of the numbers. Also, write a program to test your method.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.