I want to create some specific random, such that from 10 to 20.
rand()%20;
is create from 0 to 19
I want to create some specific random, such that from 10 to 20.
rand()%20;
is create from 0 to 19
Apply some simple arithmetic
int val = min + (rand() % range);
Where range is (max - min) + 1
A random number betweeen 10-20
is just a random number between 0-10
shifted +10