Quiz 06 ‘Greatest Common Denominator’

For this Quiz we had to find the greatest common denominator between two numbers by using Euclid’s algorithm. For example, if x = 6 and y = 12, gdc equals to six. 0,1,2,3,4 are also common denominators but six is the biggest number.

This was successfully done by the use of a recursive function such as the following:

quiz06

By the way, I am no longer using Notepad++ but Atom instead.

 

CC BY-SA 4.0 Quiz 06 ‘Greatest Common Denominator’ by rhcpalmarichie is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.