My program get crazy : <p>I tried to do a program that random 10000 numbers between 0-6 and check how much times every number get ruffle. It's get crazy and print lot's of things. please help me thanks!</p>

<pre><code>#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;time.h&gt;
#define ARR_SIZE 10000
#define NUM_OF_FACES 6

int main()
{
    srand(time(NULL));
    int arrCube[ARR_SIZE];
    int i=0,counter=0,j=0;
    for(i = 0; i&lt;ARR_SIZE; i++)
    {
        arrCube[i] = rand() % NUM_OF_FACES;
    }   
    for(i=0;i&lt;ARR_SIZE;i++)
    {
        counter=0;
        for(j=i+1;j&lt;ARR_SIZE -1;j++)
        {
            if (arrCube[i]==arrCube[j])
            {
                counter++;
            }
        }
        printf("%d times %d showed up\n",counter,arrCube[i]);
    }    

    return (0);
}
</code></pre>

<p>Another thing: I know that I can do this program with another array instead the nested loop. someone know?</p>
