Skip to content

Instantly share code, notes, and snippets.

@mrafayaleem
Created August 30, 2012 11:43
Show Gist options
  • Save mrafayaleem/3526909 to your computer and use it in GitHub Desktop.
Save mrafayaleem/3526909 to your computer and use it in GitHub Desktop.
int GCD(int a, int b) {
while(1) {
a = a % b;
if(a == 0)
return b;
b = b % a;
if(b == 0)
return a;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment