title: Bitwise operations | And | Which situation is true or false in c#
body: <p>I show my question by an example :   </p>
  
  <pre><code>    int a = 1 &lt;&lt; 0; // = 1
      int flag = 1;
      bool b = flag &amp; a; // = 1 &lt; In c++ this line has no error but in c# error is like this :
  </code></pre>
  
  <blockquote>
    <p>Cannot be applied to operands of type 'bool' and 'int'</p>
  </blockquote>
  
  <ol>
  <li><p>When <code>b</code> variable is <strong>true</strong> and when <code>b</code> variable is <strong>false</strong> in c#?  </p></li>
  <li><p>How fix the error?   </p></li>
  <li><p>When does c++ recognize that <code>b</code> variable is true? The other side should be <code>(flag &amp; a) != 0</code> or <code>(flag &amp; a) == 1</code> or something else?</p></li>
  </ol>