PPT Slide
#define N 1000main() { int i,j,a[N]; for (i=2; i<N;i++) a[i] = 1; for (i=2; i< N; i++) if (a[i]) for (j = i; j < N/i; j++) a[i*j] = 0; for (i=2; i< N; i++) if (a[i]) printf(“%d “,i); printf(“\n”);}
What is the output ?
Previous slide
Back to first slide
View graphic version