This task was about doing a programm that could calculate the GCD of two given integers using the euclids algorithm. At first i got confused because i though i could do it by using the % operator, but after doing some research about the euclids algorithm i found that is way more easy to do it that way.

The code i wrote is in here: https://github.com/sabaldaba/TC101/blob/master/wsq12-GCD

 

Basicaly you use two “if” inside two while loops. You just have to sustract the smaller to the bigger and thats pretty much all of it.

Hope you enjoy it!

CC BY 4.0 Greatest common divisor by fersabal is licensed under a Creative Commons Attribution 4.0 International License.