/****************************************************************************
** File Name: prime1.c
** Description:
**    1. the entire project is made up of "prime1.c", "prime2.c" and
**       "prime3.c." 
**    2. func0() is in "prime2.c".
**    3. func1() is in "prime3.c".
**
** Copyright 1997 Microtek International Inc.
****************************************************************************/

#define	TRUE	1
#define FALSE	0
#define SIZE    16
#define	ITER	10

char  flags[SIZE+1];
extern int func0(int i);
extern int func1(int i);

main()
{
	register int i,
		     prime,
		     k,
		     count,
		     iter;
   while(1)
   {
	for (iter = 1; iter <= ITER; iter++)
	{
		count = 0;

		for (i = 0; i <= SIZE; i++)
		{
			flags[i] = TRUE;
		}

		for (i = 0; i <= SIZE; i++)
		{
			if (func0(i))
			{
				prime = func1(i);

				for (k = i + prime; k <= SIZE; k += prime)
				{
					flags[k] = FALSE; 
				}

				count++;
			}
		}
	}
  }
}
