I want to fill an array with random integers from -10 to 10. My function looks like this:
int array(int a[], int n, int min, int max){
for(int i=0;i<n;i++){
a[i]=(rand()%min);
printf("%d ", a[i] );
}
In main I have declared "min" to -10. But it does not really work, it still prints between 0 - 9. I have tried with +1 after min, then i get 10, but still no negative integers.