static char rcsid[] = "$Id: gcd.c,v 1.6 2003/08/29 16:51:07 ecen2120 Exp $"; int Biggest[5] = {0, 0, 0, 0, 0}; int In = 0; int gcd(int x, int y) /* Compute the greatest common divisor of two integers * On exit- * gcd is the greatest common divisor of x and y * Biggest[In] contains the largest common divisor found by gcd since * this executable was loaded */ { while (x != y) if (x < y) y -= x; else x -= y; if (x > Biggest[In]) { In++; if (In == 5) In = 0; Biggest[In] = x; } return x; }