generateRandomNumber function layout help!

I need to create a function that will generate a random number between 1-25000. I am completely lost when creating the test code, so I haven't been able to validate this. I'd like to know if I'm on the right track...

Thanks!


int generateRandomNumber (int lowestRandomNumber, int highestRandomNumber)
{
int result;
lowestNumber = rand() % 25001;
highestNumber = rand() % 25001;


if(lowestNumber >= 0 && lowestNumber < highestNumber++)
{
if(25000 >= lowestNumber - highestNumber + 1)
{
cin >> result;
}
else
{
result = -1;
}
}
return result;
}
I can't tell my looking at this since it's just a part of a program, but did you use the srand function before this function starts?
Topic archived. No new replies allowed.