Highest Common Factors – Euclid's algorithm

Euclid's Algorithm

Euclid's algorithm to find the Highest Common Factor of two numbers is really simple.

It involves repetition and selection, but is really short.

Algorithm image

It almost looks too simple.

All the algorithm does is take the two numbers away from each other until they are the same. At that point the number you're left with is the Highest Common Factor.

Try Euclid's algorithm out on paper. Does it work? Can it really work out the Highest Common Factor of two numbers every single time?

Once you're ready to program this, make a start.

Start at Step 1