2 * Calculate all primes up to a specific number.
12 /*****************************************************************************/
14 /*****************************************************************************/
18 #define COUNT 8192 /* Up to what number? */
19 #define SQRT_COUNT 91 /* Sqrt of COUNT */
21 static unsigned char Sieve[COUNT];
25 /*****************************************************************************/
27 /*****************************************************************************/
33 /* This is an example where register variables make sense */
34 register unsigned char* S;
38 /* Execute the sieve */
40 while (I < SQRT_COUNT) {
42 /* Prime number - mark multiples */
53 /* Print the result */
54 for (I = 2; I < COUNT; ++I) {
58 if (kbhit() && cgetc() == 'q') {