title: how do i print out the avarage of several arrays with float?
body: <p>i'm just starting with getting to know C, and i'm now following the cs50 course. i have a question on the following code.</p>
  <p>I want to calculate the avarage score of the user input.</p>
  <pre><code>#include &lt;cs50.h&gt;
  #include &lt;stdio.h&gt;
  
  int main(void)
  {
  
      int s = get_int(&quot;how many scores? &quot;);
      int sum = 0;
      int score[s];
      
      for(int i = 0; i &lt; s; i++)
          {
              score[i] = get_int(&quot;score: &quot;);
              sum =  sum + score[i];
          }
      float avg = sum / s;
      printf(&quot;avarage: %f\n&quot;, avg);
  }
  </code></pre>
  <p>So, it prints the avarage, but gets round down to .0000.
  Is it because i am using a int to divide by? i have tried several things, like changing int to float, but without result.
  How do I solve this?</p>