Skip to content

Instantly share code, notes, and snippets.

@coldcue
Created February 16, 2013 22:52
Show Gist options
  • Save coldcue/4969085 to your computer and use it in GitHub Desktop.
Save coldcue/4969085 to your computer and use it in GitHub Desktop.
int lnko(int a, int b)
{
int bigger = (a>=b)?a:b, smaller = (a<=b)?a:b, ret=0, i;
for(i=1; i<=smaller; i++)
if(smaller%i==0 && bigger%i==0) ret = i;
return ret;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment