Last active
September 17, 2018 05:58
-
-
Save afishr/47cc77dc60193aaafe0bfcb90f80a273 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//GCD_LCM | |
int a1 = a, | |
b1 = b; | |
while (b1 != 0) | |
{ | |
a1 %= b1; | |
swap(a1, b1); | |
} | |
int GCD = a1, | |
LCM = (a * b) / GCD; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment