Answer:
Step-by-step explanation:
Here's an example code in C++ that generates three random numbers within the range of smallestVal and greatestVal inclusive, using seedVal as the random seed:
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int main() {
int seedVal, smallestVal, greatestVal;
// get input values for seedVal, smallestVal, greatestVal
// set the random seed
srand(seedVal);
// generate three random numbers and output them
for (int i = 0; i < 3; i++) {
int randNum = rand() % (greatestVal - smallestVal + 1) + smallestVal;
cout << randNum << endl;
}
return 0;
}
In this code, the srand() function is used to set the random seed to seedVal, so that each time the program is run with the same seedVal, the same set of random numbers will be generated. The rand() function is then used to generate a random number within the range of smallestVal and greatestVal, and the result is output to the console using cout. The loop is used to generate three random numbers.