While23. Positive integers A and B are given. Find their greatest common divisor (GCD), using Euclid's algorithm:
GCD(A, B) = GCD(B, A mod B) if \(B \neq 0\);
GCD(A, 0) = A.

Solution in Python 3:

import random

A = random.randrange(1,1000)
B = random.randrange(1,1000)
print("A = {0}, B = {1}".format(A,B))
while B > 0:
A,B = B,A%B
print("GCD: ",A)