Advertisement
Fotografiona

bsp10021.c

Sep 12th, 2012
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #include <stdio.h>
  2. main ()
  3. {
  4. int x, anzahl;
  5. double zahl, summe=0.0, mittelw;
  6. printf("\n\t S T A T I S T I K\n");
  7. printf("\nWieviele Werte wollen Sie eingeben: ");
  8. scanf("%i",&anzahl);
  9. printf("\n");
  10. for(x=1; x<=anzahl; x=x+1)
  11. {
  12. printf("Bitte %i. Zahl eingeben : ",x);
  13. scanf("%lf",&zahl);
  14. summe=summe+zahl;
  15. }
  16. mittelw=summe/anzahl;
  17. printf("\n\nSumme der Zahlen = %f", summe);
  18. printf("\nMittelwert der Zahlen = %f\n", mittelw);
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement