title: invalid initializer for rand() when assigning to array
body: <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  int main(){
      int n;
      for(int i= 0;i &lt; 5; i++ ){
      //type arrayName[arraysize];
        int arrayName[5] = rand();
          printf(&quot;array[%d] = %d\n&quot;,i,arrayName[i]);
      }
      return 0;
  }
  </code></pre>
  <p>I got an error about an invalid initializer for rand(); How do I add a random to the array and give it a range?</p>