Anonymous user
Greatest common divisor: Difference between revisions
→{{header|c sharp|C#}}
m (Added postscript function that requires no external lib) |
|||
Line 445:
Console.Read();
}
// Greatest Common Denominator using Euclidian Algorithm
private static int gcd(int a, int b) ▼
// Gist: https://gist.github.com/SecretDeveloper/6c426f8993873f1a05f7
{▼
▲{
return b==0 ? a : gcd(b, a % b);
▲ {
}
</lang>
|