Problem Solution

The formula which is used in this program is mean = average of the numbers. 

 variance = (summation( ( Xi – average of numbers) * ( Xi – average of numbers)) ) / Total no of elements. where i = 1 to N here N is the total no of elements. 

Standard deviation = Square root of the variance.

 #include<math.h>
int std(int n, int avg)
{
int pv;
pv=((n-avg)*(n-avg));
return pv;
}
void main()
{
int a,b,c,d,e;
int avg,sum=0,sdsm=0;
float var, sd;
//clrscr();
printf("\n enter any 5 numbers");
scanf("%d%d%d%d%d",&a,&b,&c,&d,&e);
sum=a+b+c+d+e;
avg=sum/5;
sdsm=sdsm+std(a,avg);
sdsm=sdsm+std(b,avg);
sdsm=sdsm+std(c,avg);
sdsm=sdsm+std(d,avg);
sdsm=sdsm+std(e,avg);
var=sdsm/5.0f;
sd=sqrt(var);
printf(" sum=%d average=%d standard deviation=%f ",sum,avg,sd);

getch();
}

output: