Code:
for(x=0;x<VALUES;x++)
{      
                dice[x]=p;
                freq[p]++;
}
no?