2 Random numbers

Hi

I was wondering how I can generate 2 numbers, but not to generate random numbers with max num and min num?
I want to "generate" between two numbers like 12 and 7. I don't want to generate the numbers between them but just a random pick between those numbers.

Thanks.
Set the limits of your generator between the two numbers you specify, and make it choose integers, since I assume that's what you're looking for.

http://www.cplusplus.com/reference/clibrary/cstdlib/rand/
@zurn

What you could do is generate a random number between 0 and a 1. Then, in the program, if (rnd# generated = 0) , num = 7 else num = 12.
@whitenite1

Thanks, I was doing that, but I thought there's less 'primitive' way to do it. :-)
Thank you for your help.

Topic archived. No new replies allowed.