[Solved] Random number generator gives consistent results [closed]


you should move the srand function to the begin of main.
if you call this function twice in the same second you will get the same numbers from random()

also you should change

RandNum = 2 + (rand() % 2); 

to

RandNum = 1 + (rand() % 2);

rand() % 2 will result in 0 or 1, so adding 1 will result in 1 or 2

2

solved Random number generator gives consistent results [closed]