title: & operator with enum values in C#
body: <p>I have following code and <code>Console.WriteLine</code> is returning <code>Bottom</code> even though Bottom is not in both enum expressions.</p>
  
  <p><strong>Question</strong></p>
  
  <p>What is the logic behind returning Bottom in code snippet given below? My understanding of &amp; operator is that it returns the common part, but in this case there is nothing common between the two enum expressions.</p>
  
  <pre><code>void Main()
  {
      Console.WriteLine(( Orientations.Left | Orientations.Bottom) &amp; 
                       (Orientations.Right| Orientations.Top));//returns Bottom
  }
  
  
  [Flags]
  public enum Orientations {
  Left = 0, Right= 1, Top=2, Bottom =3
  };
  </code></pre>