I wrote this function to produce random numbers within a certain range. I noticed that it seems to produce negative numbers more when I included a negative range. e.g. -5 to 5
I am assuming this is not random. Is there a problem with this code?
int random_number_generator(int lowest, int highest)
{
srand((unsigned)time(0));
int random_integer;
random_integer = lowest+(rand()%highest);
cout << random_integer << endl;
}