Tag Archives: #wsq12

#WSQ12 Greatest Common Divisor. Check my code on Github https://github.com/Auralgo/-TC1017/blob/master/wsq12.cpp Here’s a link where I found a code //http://fahad-cprogramming.blogspot.mx/2013/11/find-greatest-common-divisor-gcd-of-two.html, i just write it into function.

Greatest Common Divisor. Check my code on Github https://github.com/Auralgo/-TC1017/blob/master/wsq12.cpp Here's a link where I found a code //http://fahad-cprogramming.blogspot.mx/2013/11/find-greatest-common-divisor-gcd-of-two.html, i just write it into function.

#WSQ12

Greatest Common Divisor – WSQ12

Greatest Common Divisor

Source code of the program in GitHub.

This program basically asks the user for two numbers, and after that it calls for the function gcd to calculate the greatest common divisor of both numbers. 

The Greatest Common Divisor can be obtained very easly by contemplating three different escenarios, two of those are almost the same and are when one of the values is greater than the other, and the other is when the two are the same.

The goal of the function is to achieve that both numbers are the same so that the gcd is the same number. So we achieve this by using a simple if control form. Whenever a number is greater than the other we substract the smaller number from it and repeat the process until we have the same number.

This program is quite simple and you can try it so you better understand it.

This is my of my .

Greatest common divisor

Greatest Common Divisor

Since this WSQ was similar to a quiz, I just checked for bugs just in case, and corrected a few stuff… =) Here’s my code

https://github.com/Sgarciaq91/TC1017/blob/master/greatgood.cpp

 

GCD

 

The greatest common divisior is simple, if you catch the use of loops.

here is my solution:

LINK: https://github.com/JairBarragan/WSQs/blob/master/WSQ12

Wsq 12

Greatest Common Divisor

Helpfull Sources:
https://www.youtube.com/watch?v=AJn843kplDw
Github Link to my code:
https://github.com/FlorethGonzalez/Wsq-s/blob/master/wsq12.py

Wsq 12

Greatest Common Divisor

Helpfull Sources:
https://www.youtube.com/watch?v=AJn843kplDw
Github Link to my code:
https://github.com/FlorethGonzalez/Wsq-s/blob/master/wsq12.py

Wsq 12

Greatest Common Divisor

Helpfull Sources:
https://www.youtube.com/watch?v=AJn843kplDw
Github Link to my code:
https://github.com/FlorethGonzalez/Wsq-s/blob/master/wsq12.py