title: How to get nth bit values
body: <p>Im relatievly new to the whole bit shifting, and c++.</p>
  
  <p>Let's say i have an <code>uint8_t 00100100</code> (36) and i want to check if the 3th bit is set.
  Here is the code how im doing it now, for only one bit.</p>
  
  <pre><code>uint8_t x = 36;
      if(x&amp;1&lt;&lt;3)
          printf("is set");
  </code></pre>
  
  <p>how can i check if the 3th <strong>OR</strong> the 6th bit is set? I want to check several combinations of bits like 5th or 7th or 8th.</p>
  
  <p>what is the most elegant way to do it?</p>