Problem of this code:
double save;
save = (rand() % 100) / 10;
is not in precedence of operators, but because of division by integral constant 10
. Try:
save = (rand() % 100) / 10.0;
yet in case you want to generate numbers from interval <0; 10)
it would better to do:
save = ((double)rand() / ((double)RAND_MAX + 1.0)) * 10.0;
which will yield more precise results that will also be more uniformly distributed :)