Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3.  
  4. int main()
  5. {
  6. float tablica[100];
  7. float liczba;
  8. int i = 0;
  9. int a = 0;
  10. float suma=0;
  11.  
  12. while(liczba>=0)
  13. {
  14. printf("Podaj liczbe: ");
  15. scanf("%f",&liczba);
  16.  
  17. tablica[i]=(1/liczba);
  18. i++;
  19.  
  20.  
  21. }
  22.  
  23.  
  24. for(a=0;a<i;a++)
  25. {
  26.  
  27. suma=suma+tablica[a];
  28.  
  29. }
  30. printf("suma to: %f",suma);
  31.  
  32.  
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement