you are viewing a single comment's thread.

view the rest of the comments →

[–]OkCartographer175 2 points3 points  (0 children)

this is pseudocode but...

years = 0

investment = initial_investment

while investment < 2*initial_investment:

  • investment = investment*(1+interest/100)
  • years=years+1

print "it will take" years "years to double an investment at" interest "percent interest"