I am trying to generate a list of 10 randomly generated numbers in the range of 100000 to 583662 and every thing I have tried results in all numbers beginning with a 1 and no numbers higher than 199999 are ever generated. I have actually generated 1000 numbers to see if maybe it was just too small of a sample, but in 1000 numbers I should have had at least a few numbers higher than 199999, but none were. Here is the code I hae been using for this:
#include <stdio.h>
#include <cstdlib>
#include <ctime>
#define SIZE 100
int main()
{
int globalArray[SIZE] = {0};
srand((unsigned)time(0));
int count;
for (int count = 0; count < 100; ++count) {
globalArray[count] = (rand() % 483662) + 100000;
}
for (int count = 0; count < 100; ++count) {
printf("%d\n", globalArray[count]);
}
return 0;
}