/* 3 PROGRAM TO CALCULATE ARITHMETIC MEAN FOR CONTINUOUS SERIES*/
#include<stdio.h>
int main()
{
int c1[]={0,10,20,30,40,50};
int c2[]={10,20,30,40,50,60};
int f[]={12,18,27,20,17,6};
int i,x[6],xf[6],n=0,a;
float M,sf=0;
printf("\n COMPUTATION OF ARITHMETIC MEAN");
for(i=0;i<6;i++)
x[i]=(c2[i]+c1[i])/2; /* Calculation of MID POINT */
for(i=0;i<6;i++)
n=n+f[i]; /* Addition of Frequency */
for(i=0;i<6;i++)
{
xf[i]=x[i]*f[i]; /* Multiplication of X and Frequency */
sf=sf+xf[i]; /* Addtion of X*Frequency */
}
printf("\n\n\t Class Limit\t Mid Value\t Frequency\tFX\n\n");
for(i=0;i<6;i++)
printf("\n\t%d-\%d\t\t%d\t\t%d\t\t%d\n",c1[i],c2[i],x[i],f[i],xf[i]);
M=sf/n;
printf("\nTotal Frequency:- %d",n);
printf("\nTotal FD:- %f",sf);
printf("\n Arithmetic mean is:- %f",M);
return 0;
}
/* OUTPUT:-
COMPUTATION OF ARITHMETIC MEAN
Class Limit Mid Value Frequency FX
0-10 5 12 60
10-20 15 18 270
20-30 25 27 675
30-40 35 20 700
40-50 45 17 765
50-60 55 6 330
Total Frequency:- 100
Total FD:- 2800.000000
Arithmetic mean is :- 28.000000
*/
Good
ReplyDeleteGood
ReplyDelete