title: How do I make a function that resets a while loop?
body: <p>I have made a program that outputs <code>0 3 6 9 12</code>. Now, I want to make a function called <code>reset()</code> that resets the program, so it outputs the same numbers after 12. How do I do that?</p>
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;iostream&gt;
  using namespace std; 
  
  void byThrees();
  void reset(); 
  
  int i = 0; 
  
  int main()
  {
      byThrees();   
      return 0; 
  }
  
  void byThrees()
  {
      while(i&lt;13) {
          cout &lt;&lt; i &lt;&lt; ' '; 
          i += 3; 
      }  
  }
  
  void reset()
  {
       
      
  }
  </code></pre>