home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 333_02 / p016.awk < prev    next >
Text File  |  1989-04-22  |  231b  |  10 lines

  1.  
  2. # interest2 - compute compound interest
  3. #   input:    amount rate years
  4. #   output:    compounded value at the end of each year
  5.  
  6.     {
  7.     for (i = 1; i <= $3; i = i + 1)
  8.         printf("Year %d\t%.2f\n", i, $1 * (1 + $2) ^ i)
  9.     }
  10.