fork download
  1. #include <stdio.h>
  2.  
  3. float countCoins(int euro2, int euro1, int cent50, int cent20, int cent10, int cent5, int cent1) {
  4. float result = euro2 * 2.0 +
  5. euro1 * 1.0 +
  6. cent50 * .5 +
  7. cent10 * .1 +
  8. cent20 * .2 +
  9. cent5 * .05 +
  10. cent1 * .01;
  11. return result;
  12. }
  13.  
  14. int main(void) {
  15. printf("%f", countCoins(5, 2, 2, 5, 15, 0, 2));
  16. // your code goes here
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0s 5292KB
stdin
Standard input is empty
stdout
15.520000