title: what is the difference between while(n--) and while(n=n-1)?
body: <p>What is the difference between <code>while(n--)</code> and <code>while(n=n-1)</code>? When I use <code>while(n=n-1)</code> in my code, I can input less than 1 number.</p>
  
  <p>Example: First input 3 than input 3 times a single number (but not happening this in <code>while(n=n-1)</code>).
  But when I use <code>while(n--)</code>, it's normal. </p>
  
  <p>My code is : </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main()
  {
      int n;
      long long inum;
      scanf("%d", &amp;n);
      while(n--)
      {
          scanf("%lld", &amp;inum);
          if(inum == 0 || inum % 2 == 0)
          {
              printf("even\n");
          }
  
          else
          {
              printf("odd\n");
          }
      }
  
      return 0;
  }
  </code></pre>