title: How to make the a code repeat itself while changing the month date in C?
body: <p>I have done this code and I have made a loop where my code will restart from scratch however I want the program to restart while changing the month date and also asking the user how many months they would like so the program will run a certain amount of times, as I have added the month 1 being the first month.</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;stdlib.h&gt;
  float twag(float amount,float rate)
  {
      float si;
      si = (amount * rate) / 100;
      return si;
  }
  
  float twag2(float amount,float rate)
  {
      float er;
      er = twag(amount, rate) + amount;
      return er;
  }
  
  int main() 
  {
      char answer;
      do {
          float amount;
          float rate;
          float si;
          float er;
  
          printf("Month1\n");
  
          printf("\nEnter intial deposit : ");
          scanf("%f", &amp;amount);
  
          printf("\nEnter Rate of Interest : ");
          scanf("%f", &amp;rate);
  
          printf("\nSimple Interest : %.2f \n", twag(amount,rate));
  
          printf("\nEnd Payment: %.2f \n",twag2(amount,rate));
  
          if (amount &lt;= 100)
              printf("interest rate should be 10%%\n");
  
          else if (amount &lt;= 200)
              printf("interest rate should be 50%%\n");
  
          else if (amount &lt;= 500)
              printf("interest rate should be 80%%\n");
  
          else if (amount &gt;= 500)
              printf("interest rate should be 90%%\n");
          system("PAUSE");
  
  
          printf("\nPress Y to continue to the second month or Press any Key To 
          Exit");
          scanf(" %c", &amp;answer); // 
      }
       while (answer == 'y' || answer == 'Y');
  
      return 0;
  }
  </code></pre>