ScratchData LogoScratchData
Back to popswilson's profile

Euclidean Algorithm

POpopswilson•Created June 3, 2010
Euclidean Algorithm
0
0
193 views
View on Scratch

Description

This project computes the greatest common factor between two integers using the Euclidean algorithm. It’s a tutorial on using and swapping variables in a project. The algorithm uses the mod operator to find the remainder when one integer is divided by another integer. This is the core of the algorithm. To see how the algorithm works, use paper and pencil to divide 82 by 24. Doing so, you will find the quotient is 3 and the remainder is 10. The quotient is not important to the algorithm so discard it. Now, the remainder becomes the new divisor and the divisor becomes the new dividend. Keep dividing and swapping remainders, dividends, and divisors until the remainder is zero. That divisor is the greatest common factor GCF).

Project Details

Project ID1096973
CreatedJune 3, 2010
Last ModifiedJune 3, 2010
SharedJune 3, 2010
Visibilityvisible
CommentsAllowed