Guest User

Untitled

a guest
Dec 14th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(int argc, char * argv[])
  4.  
  5. {
  6. float acc = 0.0;
  7. float inputN = 0.0;
  8. int i = 0;
  9. int N = 0;
  10.  
  11. printf("How many?: ");
  12. scanf("%d", &N);
  13. for (i = 0; i < N; i++)
  14.  
  15. {
  16. printf("Number: ");
  17. scanf("%d", &N);
  18. acc += inputN;
  19. }
  20.  
  21. acc /= (float)N;
  22. printf("acc = %f\N", acc);
  23. return 0;
  24. }
Add Comment
Please, Sign In to add comment