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
unsigned int randr(unsigned int min, unsigned int max) { double scaled = (double)rand()/RAND_MAX; return (max - min +1)*scaled + min; }
See here for other options.