Check at the C++11 pseudo random number library.
http://en.cppreference.com/w/cpp/numeric/random
http://en.wikipedia.org/wiki/C%2B%2B11#Extensible_random_number_facility
std::random_device rd;
std::uniform_int_distribution<int> distribution(1, 100);
std::mt19937 engine(rd()); // Mersenne twister MT19937
int value=distribution(engine);
if(value > threshold) ...
like this, then say all above 75 is true, and all below is false, or whatever threshold you want
Unlike rand
you can actually control the properties of the number generation, also I don't believe rand as used in other answers (using modulo) even presents a uniform distribution, which is bad.