euclid s algorithm using the structure PROG with recursion and iteration