title: Difference between "while" loop and "do while" loop
body: <p>What is the difference between while loop and do while loop. I used to think both are completely same.Then I came across following piece of code:</p>
  <pre><code>do {
          printf(&quot;Word length... &quot;);
          scanf(&quot;%d&quot;, &amp;wdlen);
      } while(wdlen&lt;2);
  </code></pre>
  <p>This code works perfectly. It prints word length and tascans the input. But when I changed it to</p>
  <pre><code>while(wdlen&lt;2){
          printf(&quot;Word length... &quot;);
          scanf(&quot;%d&quot;, &amp;wdlen);
      } 
  </code></pre>
  <p>It gives a blank screen. It do not work. So there is some functional difference between both loops. Can anybody explain it?</p>
  <p>Is there any other difference in these two?</p>