title: Having trouble calculating the average of 5 numbers in C
body: <p>I am very new to C and to programming and I am having issues with getting the average of 5 numbers. I have tried everything I could think of and I have not clue why I am not getting a number besides 0. My code is:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main (void)
  {    
    long int first,second,third,fourth,fifth, sum;   
    float avg = (first+second+third+fourth+fifth)/5;     
    printf("Please put in five numbers\n");    
    scanf("%d%d%d%d%d", &amp;first, &amp;second, &amp;third, &amp;fourth, &amp;fifth);    
    printf("You entered: %d %d %d %d %d\n" , first, second, third, fourth, fifth);    
    sum = first+second+third+fourth+fifth;    
    printf("The sum of the numbers you entered is %d\n",
              sum);    
    printf("The average is %d\n", avg);    
  
    return 0;
  }
  </code></pre>