title: How can I create a loop that terminates at any desired year (C++)?
body: <p>I was faced with creating a program that can tell a user how much interest will be added to a product after any arbitrary number of years. I had to use a loop to estimate the new price, among other things. </p>
  
  <p>The problem I ran into was in the creation of the loop. I didn't know how to make it stop at any specific year that a user chose. What I did is made a for loop that outputted the loop for the next 99 years. This was my loop:
  for (time>0; time&lt;=99; time++) where time was the number of years from today.</p>
  
  <p>This is obviously not ideal. I wrote this in frustration from not knowing how to create a loop that can end wherever the user wants. How can I create a loop that terminates at any desired year?</p>