Wednesday 21 December 2011


TO DISPLAY THE MEAN AND STANDERD DEVIATION OF THREE NUMBERS




To compute mean and standard deviation of three number a,b,c
#include<stdio.h>
#include<math.h>
Void main()
{
Float a,b,c,d,m,sd;
Clrscr();
Printf(“enter three numbers”);
Printf(“first number ?”);
Scanf(“%f”,&a);
Printf(“second number ?”);
Scanf(“%f”,&b);
Printf(“third number ?”);
Scanf(“%f”,&c);
M=(a+b+c)/3.0;
Sd=sqrt((pow(a-m),2)+pow(b-m),2)+pow(c-m),2))/3.0;
Printf(“average of %g,%g and %g is %g”,a,b,c,sd);
Getch();
}

No comments:

Post a Comment