title: Meaning of (n & 1 << b) in C++
body: <p>While referring a C++ code written by someone else in CodeChef for a particular problem I found a new way(at least for me) of writing a conditional statement like this:  <code>if (n &amp; 1 &lt;&lt; b)</code>.
  The entire code snippet(a function) is as follows:</p>
  
  <pre><code>int Solve(int tim, int n)
  {
      if (tim &lt; 0) 
           return 1;
  
      int res = 0;
      for (int b = Maxb - 1; b &gt;= 0; b--)
          if (n &amp; 1 &lt;&lt; b) 
          {
              int my = b - __builtin_popcount(tim &amp; ((1 &lt;&lt; b) - 1));
              res += 1 &lt;&lt; my;
  
              if (tim &amp; 1 &lt;&lt; b) 
                   return res;
          }
  
      res++;
      return res;
  }
  </code></pre>
  
  <p>I know the bitwise AND operation and also a left shift operation means when we use separately. However, here the combination of both in a conditional statement made me confuse to read the logic. When I searched for the references, I couldn't find a situation where both operations come up together. Therefore, can anybody tell me the meaning or what exactly going on here?</p>