Question: Using C++ how would you generate between a range using minstd_rand0. int main() { minstd_rand0 gen; int x = 123; // set seed to 123

Using C++ how would you generate between a range using minstd_rand0.

int main() { minstd_rand0 gen; int x = 123; // set seed to 123 gen.seed(x); // generate between 1 and 18 for (int i = 0; i < 5; i++) { cout << (gen() % 18) + 1 << endl; } // generate between 19-24?? }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!