Average = (Sum of Xi)/n
#include<stdio.h>
#include<conio.h>
main()
{
int n,i,newn,sum_avg=0;
float avg;
clrscr();
printf("Enter number : ");
scanf("%d",&n);
printf("Enter numbers...");
for(i=1;i<=n;i++)
{
scanf("%d",&newn);
sum_avg=sum_avg+newn;
}
avg=sum_avg/(float)n; //Type casting.
printf("\nAverage = %f",avg);
getch();
}