title: How to find the 3rd bit of a number
body: <p>I have a question with a problem in c++.
  I have to create a program where I have to create one variable from Int and to cout&lt;&lt; on the screen &quot;True&quot; if the 3rd bit is 1.</p>
  <p>My question is: How can I see what is the 3rd bit of that number; I've tried with bitset, but couldn't solve it. Please help me.</p>
  <pre><code>#include&lt;iostream&gt;
  #include&lt;bitset&gt;
  using namespace std;
  int main()
  {
  int x; cin &gt;&gt; x;
  
  if (x % 3 != 0 &amp;&amp; bitset&lt;32&gt;(1)[2])
  {
      cout &lt;&lt; &quot;TRUE&quot;;
  }
  else
  {
      cout &lt;&lt; &quot;FALSE&quot;;
  </code></pre>
  <p>}
  This should do it right ?</p>