|
DataMuseum.dkPresents historical artifacts from the history of: CP/M |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about CP/M Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - download
Length: 640 (0x280) Types: TextFile Names: »SIEVE.C«
└─⟦4dd5d59b6⟧ Bits:30003303 Mix C version 2.1 og debugger til RC703 └─ ⟦this⟧ »SIEVE.C« └─⟦b35f94715⟧ Bits:30003295 BDS C version 1.50 arbejdsdiskette til RC703 Piccolo └─⟦b35f94715⟧ Bits:30005324 BDS C version 1.50 arbejdsdiskette til RC703 Piccolo └─ ⟦this⟧ »SIEVE.C« └─⟦b6190e06c⟧ Bits:30003304 Mix C version 2.1 til RC703 └─⟦b6190e06c⟧ Bits:30005327 Mix C version 2.1 til RC703 └─ ⟦this⟧ »SIEVE.C«
#include <stdlib.h> #define TRUE 1 #define FALSE 0 #define NITER 150 #define SIZE 8190 char flagsÆSIZE+1Å; main() æ int i, k; int iter, count; printf("%d iterations ",NITER); for (iter = 1; iter <= NITER; iter++) æ count = 0; for (i = 0; i <= SIZE; i++) flagsÆiÅ = TRUE; for (i = 2; i <= SIZE; i++) æ if (flagsÆiÅ) æ for (k = i + i; k <= SIZE; k += i) flagsÆkÅ = FALSE; count++; å å å printf("%d primesØn",count); å«eof»