I want to write a program for storing all the non-prime(composite) numbers before 10.000 in an array. I did this algorithm below, but it's not working. When I print out the array which is supposed to be holding composite numbers, it's simply counting from 4 to 10.000 . 

Where is the problem? I really looked so much but I can't see.

```
#include <stdio.h>
#define SIZE 10000

void compositeChecker(int[]);

int main() {
    int k;
    int compositeArray[SIZE]= {0};
    compositeChecker(compositeArray);
    for(k=0; k<100; k++) {
        printf("%d\n",compositeArray[k]);
    }
}

void compositeChecker(int arr[]) {
    int i,j,counter=0;

    for(i=4; i<10000; i++) {
        for(j=2; j<i; j++) {
            if((i%j)==0) {
                counter++;
            }
        }
        if(counter!=0) {
            arr[i-4]=i;
        }
    }
}

```