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
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
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;
}