title: Generating random values without time.h
body: <p>I want to generate random numbers repeatedly without using the time.h library. I saw another post regarding use the</p>
  
  <pre><code>srand(getpid()); 
  </code></pre>
  
  <p>however that doesn't seem to work for me getpid hasn't been declared. Is this because I'm missing the library for it? If it is I need to work out how to randomly generate numbers without using any other libraries than the ones I currently have.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  
  int main(void) {
      int minute, hour, day, month, year;
      srand(getpid());
      minute = rand() % (59 + 1 - 0) + 0;
      hour = rand() % (23 + 1 - 0) + 0;
      day = rand() % (31 + 1 - 1) + 1;
      month = rand() % (12 + 1 - 1) + 1;
      year = 2018;
  
      printf("Transferred successfully at %02d:%02d on %02d/%02d/%d\n", hour, 
      minute, day, month, year);
  
      return 0;
  }
  </code></pre>
  
  <p><a href="https://stackoverflow.com/questions/50285210/generating-random-values-without-time-h#comment87586416_50285273">NB:</a> <em>I can only use libraries <code>&lt;stdio.h&gt;</code> and <code>&lt;stdlib.h&gt;</code> and <code>&lt;string.h&gt;</code> — strict guidelines for an assignment.</em></p>