Advertisement
adelinedel

Journal 3B Random Numbers

Feb 21st, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. /*Adeline Delgleize
  2. Student ID 0515277
  3. February 20, 2017
  4. Journal 3B
  5. Random Numbers*/
  6.  
  7.  
  8. #include <iostream>
  9. #include <ctime>
  10.  
  11. using namespace std;
  12.  
  13. int main()
  14.  
  15. {
  16. int min, max;
  17. srand((unsigned int) time(0));
  18.  
  19. cout << "Enter your min value : " << endl;
  20. cin >> min;
  21. cout << "Enter your max value : " << endl;
  22. cin >> max;
  23.  
  24. for (int j = 0; j < 10; j++)
  25. {
  26. for (int i = 0; i < 10; i++)
  27. {
  28.  
  29. int randRange = (rand() % (1 + max - min) + min);
  30. cout << randRange << "\t";
  31. }
  32.  
  33. cout << endl;
  34. }
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41. return 0;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement