Hello guys, I have this code which generates and prints out numbers from 0 to 2. The problem is, that for some reason there is no "00" combination... The other combinations work perfectly! 01,02,10,11,12,20,21,22. How to make such that the program generates "00" as well. Thanks
Try moving srand((unsigned)time(NULL)); to before the for loop. With it inside the loop, you don't get a variety of random numbers because the srand starts reading the first number using the time seed. After changing it, I ran it with with just 100 numbers, and got plenty of 00.