(*        Teresa Tong F.4AS 30   Noverber,2001      *)
(* To calculate the compound interest after N years *)
program compound_interest;
uses wincrt;
var  P, R, A : real;
     N, I : integer;

begin
  write('Principal?');
  readln(P);
  write('Interest rate?');
  readln(R);
  write('Number of years?');
  readln(N);
  writeln;
  writeln('year      amount':8);

  A:= P;
  for I:= 1 to N do
  begin
  A:= A*(1+R/100);
  writeln(I, '        ', A:8:2)
  end;

end.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
e.g.

1) Principal?       10000
   Interest rate?       10
   Number of years?       3

   year       amount
   1         11000.00
   2         12100.00
   3         13310.00


2) Principal?       9500
   Interest rate?       12
   Number of years?       4

   year       amount
   1         10640.00
   2         11916.80
   3         13346.82
   4         14948.43

    Source: geocities.com/ttt_7_ttt/home6

               ( geocities.com/ttt_7_ttt)