Advertisement
Guest User

Untitled

a guest
Aug 25th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <conio.h>
  3. #include <math.h>
  4. int main(void)
  5. {
  6. float x, y, z,e=0, a=0, b=0,c=0;
  7. printf("Enter a number to determine how many numbers you want to add.\n");
  8. scanf("%f", &x);
  9. printf("Enter %.2f values.\n", x);
  10. for(;y<x;y++)
  11. {
  12. scanf("%f",&z);
  13. e= e +z; //arithmetic mean (mean - var 1)
  14. }
  15. e= e/x; //arithmetic mean.
  16. for (;c<x;c++)
  17. {
  18. a=pow((z-e),2);
  19. }
  20. b=sqrt(a);
  21. printf("Arithmetic Mean is: %.2f\n", e);
  22. printf("Variance is %.2f\n", a);
  23. printf("Standard Deviation is %.2f\n", b);
  24. getch();
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement