fork download
  1. #include <stdio.h>
  2. float miasomma(float x, float y);
  3. int main()
  4. {
  5. float a;
  6. float tot=0;
  7. do
  8. {
  9.  
  10.  
  11. scanf("%f", &a);
  12. tot = miasomma(a, tot);
  13. printf("%.2f\n", tot);
  14. }
  15. while (a != 10);
  16.  
  17. printf("%.2f\n", tot);
  18. return 0;
  19. }
  20.  
  21. float miasomma(float x, float y)
  22. {
  23. float somma;
  24. somma = x + y;
  25. return somma;
  26. }
  27.  
Success #stdin #stdout 0s 2172KB
stdin
3
5 
10 
33
stdout
3.00
8.00
18.00
18.00