user
You need to complete the following task:

Write an algorithm that finds the greatest common divisor (GCD) for two numbers.

284, 252

Answer:
assistant
The GCD algorithm can be used to find the greatest common divisor between two numbers.

The GCD algorithm works by taking two non-zero integers and repeatedly dividing out their largest common divisor until no common divisor is found.
1. Initialize two positive integers n1,n2 such that n1 > n2
2. Divide n1 by n2 and obtain the remainder.
3. If the reminder is 0, then GCD (n1, n2) = (n2).
4. If the remainder is not 0, set n1 = n2 and n2 = reminder.
5. Repeat until the reminder is 0.

With our integers 284, 252:
n1 = 284 and n2 = 252
284 % 252 = 32  (remainder)
n1 = 252 and n2 = 32
252 % 32 = 0  (remainder)
GCD (284, 252) = 32