title: How to toggle an int / _Bool in C
body: <p>Suppose we have an <code>int</code> and want to toggle it between <code>0</code> and <code>1</code> in a boolean fashion. I thought of the following possibilities:</p>
  
  <pre><code>int value = 0; // May as well be 1
  
  value = value == 0 ? 1 : 0;
  value = (value + 1) % 2;
  value = !value; // I was curious if that would do...
  </code></pre>
  
  <ol>
  <li>The third one seems to work. Why? Who decides that <code>!0</code> is <code>1</code>?</li>
  <li>Is something wrong with any of these?</li>
  <li>Are there other possibilities? e.g. bitwise operators?</li>
  <li>Which offers the best performance?</li>
  <li>Would all that be identical with <code>_Bool</code> (or <code>bool</code> from stdbool.h)? If not, what are the differences?</li>
  </ol>
  
  <p>EDIT: Many great answers with lots of valuable information, thanks! Unfortunately, I can only accept one.</p>