Anonymous user
Greatest common divisor: Difference between revisions
m
→Iterative: Cleaned up extra stuff
(Added Java examples.) |
m (→Iterative: Cleaned up extra stuff) |
||
Line 31:
===Iterative===
public static long gcd(long a, long b){
long factor= 0;
factor= Math.max(a, b);
for(long loop= factor;
if(a % loop == 0 && b % loop == 0){
}
}
return
}
|