title: Why does one complex bits-shifting command not act like some commands with the same logic?
body: <p>For example ,for these similar codes when I'm writing it like the first pattern the condition gets true and in the second pattern the condition gets false.</p>
  
  <p>I have watched the values of <code>mask &amp; (bits &gt;&gt; i)</code> and <code>mask</code> in real-time in the debugger tool and although they were the same the condition returned false.</p>
  
  <p>Why this weird behavior happening?</p>
  
  <p>1:</p>
  
  <pre><code>void printLetters(unsigned int bits, unsigned int i) // 0&lt;i&lt;7
  {
     unsigned int mask = 0x1;
     unsigned temp;
  
     temp = mask &amp; (bits &gt;&gt; i);
     if (temp == mask) //the same condition in other way
          printf("true");
  }
  </code></pre>
  
  <p>2: </p>
  
  <pre><code>void printLetters(unsigned int bits, unsigned int i) // 0&lt;i&lt;7
  {
     unsigned int mask = 0x1;
  
     if (mask &amp; (bits &gt;&gt; i)== mask) //the same condition in other way
         printf("true");`
  }
  </code></pre>