GCD(a, b, gcd)
input: a, b ∈ ℕ
output: gcd = greatest common divisor of a and b
while a ≠ b
if a > b
a ← (a - b)
else
b ← (b - a)
gcd ← a
// Pseudocode conventions:
// ← instead of = for assignment
// Blocks by indentation (no semicolons, no braces)
// null = no value (also for numbers)
// a.length = length of array a
// Data types: ℕ, ℤ, ℚ, ℝ
// Comparisons: <, >, ≤, ≥, =, ≠