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
repeat
let
r
:=
a
mod
b
let
a
:=
b
let
b
:=
r
until
r
= 0
return
a