To find and print the standard deviation.
Write a program in C to input 12 numbers and then calculate, print the standard deviation of these numbers.
H&R Block At Home 2009 Deluxe Federal + State + eFile [Formerly TaxCut] [Download]
H&R Block At Home 2009 Deluxe Federal + State + eFile [Formerly TaxCut] [Download]
#include< #include< #include< #define N 12 void main( ) { float x, sx, sxx, sd, a; sx = sxx = 0; for (a=1; a<=N; a++) { printf("Enter value of x"); scanf("%f", &x); sx = sx + x; sxx = sxx + x * x; } sd = sqrt(sxx / N - (sx/N) * (sx/N)); printf("Standard Deviation is %.2f\n", sd); } |
---|
0 comments:
Post a Comment