Standard Deviation Program in C
#include<stdio.h> #include <math.h> float standard_deviation(float data[]); int main() { int i; float arr[10]; printf("Enter the elements: "); for(i=0; i < 10; ++i) scanf("%f", &arr[i]); printf("\nStandard Deviation = %.6f", standard_deviation(arr)); return0; } float standard_deviation(float arr[]) { float sum = 0.0, mean, standDev = 0.0; int i; for(i=0; i<10; ++i) { sum += arr[i]; } mean = sum/10; for(i=0; i<10; ++i) standDev += pow(arr[i] - mean, 2); return sqrt(standDev/10); }
Output:-

Normally I don’t read article on blogs, but I would like to say that this write-up very forced me to try and do it! Your writing style has been amazed me. Thanks, very nice article.
Like!! I blog quite often and I genuinely thank you for your information. The article has truly peaked my interest.