Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. // Lec12.cpp
  2. #include <iostream>
  3. #include <iomanip>
  4. using namespace std;
  5.  
  6.  
  7. int main()
  8. {
  9. srand((unsigned int)time(0)); // don't call srand in a loop...just once at the beginning
  10.  
  11. for (int i = 0; i < 15; i++) {
  12. int randNum = 1 + rand() % 100;
  13. cout << randNum << endl;
  14.  
  15. }
  16.  
  17.  
  18. system("pause");
  19. return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement