This is a follow on from a previously posted question:
How to generate a random number in C?
I wish to be able to generate a random number from within a part
Here is a formula if you know the max and min values of a range, and you want to generate numbers inclusive in between the range:
r = (rand() % (max + 1 - min)) + min