Average number calculation using c programming || program to calculate average of unlimited numbers

Here is the program to find the average of unlimited numbers:

program:

#include <stdio.h>
#include <stdlib.h>

float averageByAsking()
{
int N, i;
printf(“Enter how many number do you wanted the average of: “);
scanf(“%d”, &N);
float sumbag[N], Average, AverageSum = 0;
for(i=0; i<N; i++){
printf(“Enter the %d number: “, i+1);
scanf(“%f”, &sumbag[i]);
AverageSum = AverageSum + sumbag[i];
}
Average = AverageSum / N;
printf(“\nThe average of entered numbers is: %.3f”, Average);


}

int main()
{
averageByAsking();
return 0;
}

result:

Enter how many number do you wanted the average of: 5

Enter your 1 number: 1

Enter your 2 number: 2

Enter your 3 number: 3

Enter your 4 number: 4

Enter your 5 number: 5

The average of entered number is: 3

thanks you very much….