title: Implicit declaration of functions srand, rand and system
body: <p>Trying to solve an exercise where I have to print a random temperature value between 35°C &amp; -10°C every 5 seconds followed by the date and time. Everything looks to be working as intended, however when I enter the code in a test script I get following errors.</p>
  
  <p><img src="https://i.imgur.com/JG1igOL.png" alt="implicit declaration of functions errors">
  This is my code:</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;unistd.h&gt;
  #include&lt;time.h&gt;
  #define temp_max 35
  #define temp_min -10
  #define FREQUENCY 5
  
  int main(void)
  {
  srand(time(NULL));
  while(1)
  {
  int number = rand() % (temp_max*100 - temp_min*100) + temp_min*100;
  double temperature = (double) number;
  temperature /= 100;
  printf("Temperature=%1.2f @ ",temperature);
  fflush(stdout); 
  system("date");
  sleep(FREQUENCY);
  }
  return 0;
  }
  </code></pre>
  
  <p>These are my results:</p>
  
  <p><img src="https://i.imgur.com/VgSLPmt.png" alt="These are my results"></p>
  
  <p>This is what the test script checks for:</p>
  
  <p><img src="https://i.imgur.com/fry3Fh3.png" alt="This is what the test script checks for"></p>
  
  <p>As I am unable to see my own mistakes, any help would be greatly appreciated.</p>