title: Calculating total return with compound interest
body: <p>So, I'm trying to figure out the total amount of return from an investment of £5 with a daily interest rate of 1.01%. Obviously, I am wanting the compound interest rate, so I have this so far:</p>
  
  <pre><code>int main() {
  
      double i = 500;
      int loop;
      int loopa;
      double lowInterest;
      double highInterest;
  
      lowInterest = 1.01;
      highInterest = 1.75;
  
      cout.precision(2);
  
          for(loop = 1;loop &lt; 1826;loop++) {
              if(i&lt;1001) {
                  i = i + ((i / 100) * lowInterest);
              }
              else {
                  i = i + ((i / 100) * highInterest);
              }
          }
  
      cout &lt;&lt; fixed &lt;&lt; i &lt;&lt; endl;
  
      return 0;
  
  }
  </code></pre>
  
  <p>I am using 500 to represent the $5 just for personal preference. Am I doing this correctly? I get very strange results - 46592024576.00 for example - that make me think that somewhere I've made an error?</p>
  
  <p>Any suggestions?</p>