--Originally published at JAVALIO
During this first exercise in programming Cesar Cortez, Andres Choza and me, worked together because we have doubts about how to begin in Java world, after we talk for minutes we decided to start and at the end of the day, all of us knew a little bit more of Java, I have to thank them because with their help I can programming better than before.
Greatest Commmon Divisor is a wsq where we have to find what’s the GCD of a number given, “when at least one of them is not zero, is the largest positive integer that divides the numbers without a remainder. For example, the GCD of 8 and 12 is 4” (Wikipedia,2016)
We use the method where you take both number and begin divide them by 2 then by 3 and go on, until the both of them cannot divide more with a same number, then multiply the numbers that pass and there is the result.
Here’s our code:
Github: https://github.com/cesarau04/WSQ-Java/blob/master/wsq06.java
Image by: Jorge Franganillo