Ok... 2 things: Instead of dealing with short int, use int.
And, to obtain an value inside a range using rand(), this:
range * rand() / RAND_MAX
won't do what you expect.
Try:
I'll let you figure it out why...Code:lotto[i] = lowest + range * ( rand() / ( RAND_MAX + 1.0 ) );