Question: a. In the language of your choice implement a function called gcd1 that takes two inputs a and b and returns the greatest common divisor
a. In the language of your choice implement a function called gcd1 that takes two inputs a and b and returns the greatest common divisor of a and b using the sequential Euclidean Algorithm.
b. Implement a function called gcd2 that takes two inputs a and b and returns the greatest common divisor of a and b using the recursive Euclidean Algorithm.
Test your functions by writing a program that computes and prints the return values of the following
gcd1(1607, 1609) gcd2(1607, 1609)
gcd1(1000, 750) gcd2(1000, 750)
gcd1(99999, 99999) gcd2(99999, 99999)

#1 [16 points) (2.3-24, 3.1) a. In the language of your choice implement a function called gcd1 that takes two inputs a and b and returns the greatest common divisor of a and b using the sequential Euclidean Algorithm b. Implement a function called gcd2 that takes two inputs a and b and returns the greatest common divisor of a and b using the recursive Euclidean Algorithm. Test your functions by writing a program that computes and prints the return values of the following gedl(1607, 1609) ged2(1607, 1609) gedl(1000, 750) ged2(1000, 750) ged1(99999,99999) ged2(99999,99999)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
