title: 'do...while' vs. 'while'
body: <blockquote>
    <p><strong>Possible Duplicates:</strong> <br/>
    <a href="https://stackoverflow.com/questions/390605/while-vs-do-while">While vs. Do While</a> <br/>
    <a href="https://stackoverflow.com/questions/3094972/when-should-i-use-do-while-instead-of-while-loops">When should I use do-while instead of while loops?</a></p>
  </blockquote>
  
  
  
  <p>I've been programming for a while now (2 years work + 4.5 years degree + 1 year pre-college), and I've never used a do-while loop short of being forced to in the Introduction to Programming course. I have a growing feeling that I'm doing programming wrong if I never run into something so fundamental.</p>
  
  <p>Could it be that I just haven't run into the correct circumstances?</p>
  
  <p>What are some examples where it would be necessary to use a do-while instead of a while?</p>
  
  <p>(My schooling was almost all in C/C++ and my work is in C#, so if there is another language where it absolutely makes sense because do-whiles work differently, then these questions don't really apply.)</p>
  
  <p>To clarify...I know the difference between a <code>while</code> and a <code>do-while</code>. While checks the exit condition and then performs tasks. <code>do-while</code> performs tasks and then checks exit condition.</p>