title: how could I carry over the number for example month 1 = 100 then add that to the answer for month 2? this code is a simple probably not the best
body: <pre><code>#include&lt;stdio.h&gt;
  int main() {
  
  float savings, interest; 
  int month, months=6;
  for (month=1;month&lt;=months;++month){
  printf(&quot; Enter the saving &quot;);
  scanf(&quot;%f&quot; , &amp;savings);
  
  interest= savings + 101.417; 
  
  //(month * savings *1+0.00417* 101.00417 = interest)
  
  printf(&quot;%.2f savings = %.2f interest for month %d \n&quot; , savings , interest ,month); 
  }
  return 0;
  
  }
  </code></pre>
  <p>this code is not the best but its trying to work out the interest for a savings account, this is a piece of work written in c.</p>