[solved]-Code 78 Random Number Generator 1 Include 2 Include 3 Include 4 Include 5 Using Namespace Q39069139

Code 7.8: Random number generator 1 #include <iostream> 2 #include <cmath> 3 #include <cstdlib> 4 #include <ctime> 5 using namespace std; int main() { int n, r; srand(time(NULL)); cout << “How many numbers do you want? “; cin >> n; for (int i = 1; i <= n; i++) { r = rand() % 9 + 1; cout << r << “” return 0; What is the range of numbers generated by the program? Modify the program to display a frequency distribution of the values and graph the results. Sample output: How many number do you want? 20 2 263 2 3 4 1 4 3 4 5 5 4 3 3 3 3 4 2 Value Freq Graph ***** * ******* -amino * ******** * * Show transcribed image text Code 7.8: Random number generator 1 #include 2 #include 3 #include 4 #include 5 using namespace std; int main() { int n, r; srand(time(NULL)); cout n; for (int i = 1; i
Expert Answer
Answer to Code 7.8: Random number generator 1 #include 2 #include 3 #include 4 #include 5 using namespace std; int main() { int n,… . . .
OR

