0

I was trying to figure out the calculation 85 = 7s mod 5

I have no idea how to do it but the text book I use says it is easy to use Euclidean's algorithm for such calculations

Can some one tell me how to complete this calculation

Thanks

user3109117
  • 11
  • 1
  • 4

1 Answers1

0

Here it is in C#:

    public static int GCD(int a, int b)
    {
        while (a != 0 && b != 0)
        {
            if (a > b)
                a %= b;
            else
                b %= a;
        }

        if (a == 0)
            return b;
        else
            return a;
    }
P Lysenius
  • 1,133
  • 1
  • 13
  • 25