title: Writing a program that fills an array of 100 integers from 1 to 100
body: <p>So im having a minor problem with this. I just dont know if im doing it correctly. The question is vague. (to me) Was wondering if I could get some help because ive been at this simple problem in my book for 2 hours now and its ticking me off! Thanks in advance :)</p>
  
  <p>"Write a program that populates "fills" an array of 100 integer elements with the numbers from 1 to 100 and then outputs the numbers in the array." </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;iomanip&gt;
  using namespace std;
  
  int main()
  {
  const int size = 301;
  int N, I, k;
  int score[size];
  srand(time(0));
  
  
  cout   &lt;&lt; setprecision(2)
         &lt;&lt; setiosflags(ios::fixed)
         &lt;&lt; setiosflags(ios::showpoint);
  
  //1)Get # of bowlers ..............................................................
        cout &lt;&lt; "Enter number of bowlers? (Must be between 1 and 301) ";
        cin &gt;&gt; N;
        while (N&lt;1||N&gt;size)
  {
        cout &lt;&lt; "\nError!! Must be between 1 and 301!! ";
        cin &gt;&gt; N;
  }
  //2) and 5)  Get scores ............................................................
  for(I = 0; I&lt;N; I++)
  {
  //cout &lt;&lt; "\nEnter score for bowler # " &lt;&lt; I + 1 &lt;&lt; " ";
  //cin &gt;&gt; score[I];
  score[I]=rand()%301;
  
  for(k=0; k&lt;I; k++)
  {
      if(score[k]==score[I])
      {
          I--;
          break;
      }
  
  }
  }
  
  //3)Get Sum/Avg .....................................................................
  int sum = 0;
  float avg;
  for(I = 0; I&lt;N; I++)
  {
  sum += score [I];
  
  }
  
  avg = float(sum)/N;
  
  
  
  
  //4) Output scores, sum, and avg ....................................................
  
  for(I = 0; I&lt;N; I++)
  {
  cout &lt;&lt; "\nScore for bowler # " &lt;&lt; I + 1 &lt;&lt; " is  "  &lt;&lt; score[I];
  
  }
  cout&lt;&lt;"\n\n The Sum is " &lt;&lt; sum &lt;&lt; "\n";
  cout &lt;&lt;"\n The Average is "&lt;&lt; avg &lt;&lt; "\n";
  
  
  cout&lt;&lt;"\n\n\n";
  system ("pause");
  return 0;
  }
  </code></pre>