+ 2
HERE IS MY LITTLE POWERFUL CODE TO FIND GCD EASILY
I think its simple code but it can find the gcd of two given numbers, beside that it also displayed to the screen how you can manually find it. https://code.sololearn.com/cBxoSLFQzEzf/#cpp any suggestions will be appreciated.
5 Respostas
+ 4
I did not understand what's your initial question... and not enough usually using C++ to study your code, but principles explained and implemented in my related codes could maybe help you ^^
+ 2
JS gcd function:
https://code.sololearn.com/WteKxMC4vDvC/?ref=app
first part, prime number function:
https://code.sololearn.com/WPXD8LSoeiIL/?ref=app
0
Visph, Did you get some suggestions for me to take correction?
0
Thnks @visph
- 1
the recursion is unnecessary. use a loop or use a recursive GCD calculation method. this is an abuse of recursion. syntactically correct though.