Advertisement
kamandos

HomeWork

Jul 15th, 2022
755
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.34 KB | None | 0 0
  1. #include <stdio.h>
  2. void value(void);
  3.  
  4. void main ()
  5. {
  6.     value();
  7. }
  8.  
  9. void value(void)
  10. {
  11.     float year = 1, period = 5, amount = 5000, inrate = 0.12;
  12.     float sum;
  13.     sum = amount;
  14.     while (year <= period) {
  15.         sum = sum * (1 + inrate);
  16.         year = year + 1;
  17.     }
  18.    
  19.     printf("The total amount is %f:", sum);
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement