title: C++ Generating a 4 digit random number
body: <p>I need to generate a 4 digit random number in C++</p>
  
  <p>I used the following code</p>
  
  <pre><code>#include&lt;time.h&gt;
  
  int number;
  
  number=rand()%1000;
  srand ( time(NULL) );
  </code></pre>
  
  <p>but its doesn't gives a total random number</p>