You can use the modulo operator to limit the range and rand srand are good with just C I think.

srand((unsigned)time(0));

randomnumber = rand()%10+1;

It's a minor nitpick, but I couldn't refuse: statistically that's not quite correct.
Consider this informal 'proof': when you put the numbers 0, 1, 2 ... 2^151 in
jars numbered 0, 1, 2, ... 9 where the random number % 10 is the jar number,
you'd notice that the jars 0, 1, 2, 3, 4, 5, 6, 7 have one number more in them
than the other two jars 8 and 9 while each jar should be filled with the same
number of numbers.
To straigten up this slight bias you should reject any random number greater
than RAND_MAXRAND_MAX%nof_jars and try a next random number for
further processing.
kind regards,
Jos