This WSQ consisted on using the Euclidean Algorithm to calculate the Greatest Common Divisor of two values. To understand this concept I had to watch a video explaining it: https://www.youtube.com/watch?v=AJn843kplDw

Afterwards, it resulted easy to turn this into code since it consists on repetition and reassignment of values. I had no trouble since I have done it in previous WSQs. The idea of turning it into a funtion was simple since it consisted only on grabbing that segment of the code and turning it into a function.

Here’s the code: 

https://github.com/CarlosGallegosT/Codes007/blob/master/Euclidean_Algorithm.cpp

                                          

Image Source: http://web.williams.edu/Mathematics/lg5/C15W13/summary.html

CC BY 4.0 Euclidean Algorithm #WSQ12 by Carlos Gallegos is licensed under a Creative Commons Attribution 4.0 International License.