I am not sure how to write this program. Any help is needed as I am stuck and this program is due soon. I am very very new to c++ so looking at other similar programs is of no help
Section 0 : A function that generates a random number of a given range.
Section 1 : Receive the range for the random number.
Section 2 : Receive how many random numbers to be generated.
Section 3 : Generates random numbers of the given range.
*/
#include <iostream>
#include <ctime>
usingnamespace std;
int myrand(int min, int max)
{
}
int main()
{
srand(time(NULL)); // It sets the random number seed.
cout << "Input minimum number:";
cin >> min;
cout << "Input maximum number:";
cin >> max;
return 0;
}
#include <iostream>
#include <ctime>
usingnamespace std;
int myrand(int min, int max)
{
int x = min + rand() % ((max + 1) - min);
return x;
}
int main()
{
int min;
int max;
cout << "Input maximum number:";
cin >> max;
cout << "Input minimum number:";
cin >> min;
srand(time(NULL)); // It sets the random number seed. }
return 0;
}