Advertisement
tatad

Random Number Generator

Nov 21st, 2013
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. #include <ctime>
  4.  
  5. int main()
  6. {
  7.     int rdmNum;
  8.    
  9.     /*int seed;
  10.     seed = time(0);
  11.     srand(seed);*/   //Optional
  12.    
  13.     for (int i = 0; i < 30; i++)
  14.     {      
  15.         rdmNum = 1 + rand() & 1000;
  16.         cout << rdmNum << endl;
  17.     }
  18.  
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement