[Solved] C++, twenty numbers not random? [closed]
You need to call rand() each time you want a random number. As you have it now you’re generating one random number, then incrementing it and printing it out 20 times so you’re going to get 20 sequential numbers. Try something like srand(time(NULL)); // Seeding the random number generator for(int i=0; i<20; ++i) { cout … Read more