Calculates the Average Score of Given Number of Scores in C
Reduce the number of loops
The most time-consuming part of your program is to loop through the array. Notice that you have done this twice, why can't you keep a track of the total sum while taking the input?
#include &lt;stdio.h&gt;  

float average(int sum,int number);

int main(void)
{
    int number_of_integers,number,sum = 0;
    printf(&quot;Enter the number of integers: &quot;);
    scanf(&quot;%d&quot;,&amp;number_of_integers);
    for(int i = 0;i &lt; number_of_integers;i++)
    {
        printf(&quot;Enter: &quot;);
        scanf(&quot;%d&quot;,&amp;number);
        sum+=number;
    }
    printf(&quot;Average = %d&quot;,average(sum,number_of_integers));
}

float average(int sum, int number)
{
    return sum/(float)number;
}

This reduces the number of loops from 2 into 1. And completely removes the need of having an array of integers. Making your program both memory efficient and fast.