+ 2
Write a program to print the common division of any two given numbers?
2 Respostas
+ 4
Euclidean and binary GCD algorithms written in Java (this was a while back):
https://code.sololearn.com/cSmM1BVjMiHO/?ref=app
https://code.sololearn.com/cFmKZ0d9XELk/?ref=app
+ 3
I think you mean Common Divisor (also known as the Greatest Common Divisor), and not Common Division.
I wrote this for you (it's based on the Binary Method, as taken from https://en.wikipedia.org/wiki/Greatest_common_divisor#Binary_method)
Here is my code:
https://code.sololearn.com/crhhi243FNgN
Any questions, please let me know.
*** Apologies! Only just noticed one of your tags says Java! LunarCoffee's solution looks fantastic for Java. I'll leave my code up in C++, in case anybody else finds that useful.