Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- int main()
- {
- int a[50], n, i, b[50], j;
- float avg, sum = 0, nsum = 0, avg_sq_d, result;
- printf("Enter the number of elements: ");
- scanf("%d", &n);
- printf("Enter the elements: ");
- for (i = 1; i <= n; i++) {
- scanf("%d", &a[i]);
- sum += a[i];
- }
- avg = sum / n;
- for (i = 1; i <= n; i++)
- nsum += pow((a[i] - avg), 2);
- avg_sq_d = nsum / n;
- printf("Standard Deviation = %.3lf", sqrt(avg_sq_d));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement