I am new to programming C++, so I am trying to make a simple Slot Machine Program. Everything works fine, except the random numbers. Every time I run the program, I get the same three "random" numbers! Here is the code I am using for my random numbers:
int x=rand()%21;
int y=rand()%21;
int z=rand()%21;
The numbers I keep getting are 20, 8, and 13. The random numbers I want to get is the range of 1 to 20.
Thank you all for your help!



LinkBack URL
About LinkBacks



