Skip to content

Instantly share code, notes, and snippets.

@afishr afishr/GCD_LCM.c
Last active Sep 17, 2018

Embed
What would you like to do?
//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
You can’t perform that action at this time.