title: generate a random number between 1 and 10 in c
body: <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main()
  
  {
      int randomnumber;
      randomnumber = rand() % 10;
      printf("%d\n", randomnumber);
      return 0;
  }
  </code></pre>
  
  <p>This is a simple program where randomnumber is an uninitialized int variable that is meant to be printed as a random number between 1 and 10. However, it always prints the same number whenever I run over and over again. Can somebody please help and tell me why this is happening? Thank you. </p>