To find and print mean and standard deviation.
Write a program in C to input 5 integer values (x) and to find and print their mean (m) and standard deviation (sd).
#include< #include< #include< void main( ) { int i, x[5]; float s1=0, s2=0, d, m, sd; clrscr( ); printf("Input 5 values of x, one at a time\n"); for(i=1; i<=5; i++) for(i=1; i<=5; i++) { d = s[i] - m; s2 = s2+d*d; } printf("\n The mean is %f\n", m); printf("The standard deviation is %f\n", sd); } |
---|
0 comments:
Post a Comment