Click New Example to start working through an example. Click on the steps of the algorithm to see the values of the variables in each step. First click on step 1. and then on the following steps in the order of execution.
New Example Restart Example
Algorithm. Euclidean algorithm.
Input:Two natural numbers a and b with a>b
Output:The greatest common divisor gcd(a,b) of a and b
  1. repeat
    1. let r := a mod b
    2. let a := b
    3. let b := r
  2. until r = 0
  3. return a