+ 4
How to get Greatest Common Divisor of Two numbers in Java on your own solving technique
How to get Greatest Common Divisor of Two numbers in Java on your own solving technique i think there is so many possible code to get GCD of 2 numbers can you show me some technique ?
2 Answers
+ 3
let the function gcd be:
if (a==0){
return b;
}
elif (b==0){
return a;
}
else{
return gcd(a%b,(a>b)?b:a)
+ 2
thanks for that sir @Pegasus