You will write Euclid's division method as a function, build the LCM from it, and use both on a timetable.
The idea. While is not , replace the pair by , where is the remainder of divided by . When reaches , the HCF is . Then LCM .
Your tasks.
hcf, write Euclid's method and return the HCF.lcm, return the LCM of two numbers, using hcf.together to the minutes until all three are back together for the first time.Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…