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

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