Very good question! =) Although I do not have a perfect explanation to the why, other than telling you that rand()% will not actually give you a real random number. If you want a good explanation I suggest you google for your answer. as to the solution include the library <ctime> and add srand(time(NULL)); to reset the counter. It should give you different results every time you run your program. Hope you google for your explanation though. Good Luck.