modular division function implementation ?

if a function to implemented that takes a, b, c and the function is to find a/b (mod c), for example if a = 1, b = 2, c = 7, so the function will return 4.
i have knew that it is related to euclidean extended algorithm but if someone could post an implementation of a function to do so (for better understanding of the euclidean algorithm) it would be much appreciated.
the function is to find a/b (mod c), for example if a = 1, b = 2, c = 7, so the function will return 4.
??? How is 1/2 (mod 7) = 4?
i will quote from a site which demonstrated this example:
"we can see that 1 divided by 2 at mod 7 must equal 4, since we need four 2s to get to the 1"
Topic archived. No new replies allowed.