These are the two small exercises to practice iterative algorithms as part of MITx: 6.00.1x
Find the greatest common divisor of two numbers.
- using an iterative algorithm
- using recursion
Find the largest positive inerger that divides both numbers leaving no remainder
-
To do this I used while loops to iterate through each number smaller then the smaller number given until a remainder of zero was reached
-
I used the Euclidean algorithm.