qrandomgenerator bounded 1

qrandomgenerator bounded

//example
QRandomGenerator::global()->bounded(10);//10 is excluded 0 is included
QRandomGenerator::global()->bounded(10, 12);//10 is included 12 is excluded

Here is what the above code is Doing:
1. We create a QRandomGenerator object.
2. We use the QRandomGenerator object to generate a random number between 0 and 10.
3. We use the QRandomGenerator object to generate a random number between 10 and 12.

Similar Posts