Average of the number
// average of the number
#include<stdio.h>
int main()
{
int i,n,x;
float avg,sum=0;
printf("enter the value which you want to take for the average:");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
printf("x=");
scanf("%d",&x);
sum +=x;
}
avg=sum/n;
printf("%f",avg);
}
Comments
Post a Comment