 Thus the iteration of the Euclidean algorithm becomes simply

Implementations of the algorithm may be expressed in pseudocode.For example, the division-based version may be programmed as

At the beginning of the "k"th iteration, the variable "b" holds the latest remainder "r""k"−1, whereas the variable "a" holds its predecessor, "r""k"−2.The step "b"