Checking bits in a byte using for loop
<p>I was recently studying C# where i came across following for loop</p>

<pre><code>// Display the bits within a byte.
using System;

class ShowBits { 

 static void Main() { 

  int t;
  byte val;
  val = 123; 

  for(t=128; t &gt; 0; t = t/2) { 

     if((val &amp; t) != 0)
         Console.Write("1 ");

     if((val &amp; t) == 0) 
         Console.Write("0 ");

   }
 }
}
</code></pre>

<p>I am not able to understand that Why in doing t=t/2 in the incrementing/decrementing  section of the for loop . plz explain</p>
