title: Conditional Statement using Bitwise operators
body: <p>So I see that this question has already been asked, however the answers were a little vague and unhelpful. Okay, I need to implement a c expression using only "&amp; ^ ~ ! + | >> &lt;&lt;"</p>
  
  <p>The expression needs to resemble: a ? b : c</p>
  
  <p>So, from what I've been able to tell, the expression needs to look something like:</p>
  
  <p><code>return (a &amp; b) | (~a &amp; c)</code></p>
  
  <p>This works when a = 0, because anding it with b will give zero, and then the or expression will return the right side, <code>(~a &amp; c)</code> which works because ~0 gives all ones, and anding c with all ones returns c.</p>
  
  <p>However, this doesn't work when a > 0. Can someone try to explain why this is, or how to fix it?</p>