#include
<stdio.h>
int main() {
int n=0, i;
float num[n], sum=0.0, average;
printf("How many numbers you want to
average: ");
scanf("%d",&n);
while (n<=0) {
printf("\n\nError! it should be a positive integer.\n");
printf("\n\nEnter the number
again: ");
scanf("%d",&n);
for(i=0; i<n; ++i) {
printf("\n(%d) Enter number:
",i+1);
scanf("%f",&num[i]);
sum+=num[i];
}
printf("\n\nsum = %f",sum);
average=sum/n;
printf("\n\nAverage = %.2f",average);
printf("\n\n");
return 0;
}