This fails the requirement, because it's possible that rand() will return the same number at least twice in the nine calls.
use not Num_Array.push_back(i); but something like Num_Array.push_back(rand());
The only true way to do it is to shuffle the possible values, like shuffling a deck of cards, rather than randomly picking a card from a huge pile and hoping there are no duplicates.
It looks like you did. Try telling us what you expected to happen, and what actually happened, and be as specific as possible.
I am doing what you suggested .how do I generate 9 random numbers that do not repeat?
Posted Today, 04:35 PM
What's the question?