#include<stdio.h>
#include<conio.h>
void main()
{
int i,n,sum=0,x;
float avg;
printf("\n How many numbers ");
scanf(" %d ",&n);
for(i=1;i<=n;i++)
{
printf("\n Eneter %d number ",i);
scanf("%d",&x);
sum = sum + x;
}
avg=sum/n;
printf("\n The average of numbers = %f",avg);
getch();
}
No comments:
Post a Comment