For your first case, you actually still have a 2% probability that the numbers will be the same. For the second case, you have a 10% probability that the numbers will be the same. That's why you are noticing the second case giving two of the same number.
If you want to ensure that the two numbers are difference, try one of these:
std::vector<int> temp;
// there is a std:: function for this, but I can't find it
for (int i = 0; i < 10; ++i)
temp.push_back(i);
std::random_shuffle(temp.begin(), temp.end());
int operands[2];
operands[0] = temp[0];
operands[1] = temp[1];
The second option may appear to be slower than the first option (and usually is), but the first option has the potential to go on forever. It is the uncertainty in the first option that makes me prefer the second option.