title: Difference between | and || , or & and &&
body: <p>These are two simple samples in C++ written on Dev-cpp C++ 5.4.2:</p>
  
  <pre><code>float a, b, c;
  
  if (a | b  &amp; a | c)
     printf("x = %.2f\tF = %.0f\n", x, F);
  else
     printf("x = %.2f\tF = %.2f\n", x, F);
  </code></pre>
  
  <p>and this code : </p>
  
  <pre><code>float a, b, c;
  
  if (a || b  &amp;&amp; a || c)
     printf("x = %.2f\tF = %.0f\n", x, F);
  else
     printf("x = %.2f\tF = %.2f\n", x, F);
  </code></pre>
  
  <p>Can somebody tell my difference between <code>||</code> > <code>|</code> and <code>&amp;</code> > <code>&amp;&amp;</code>. The second code works , but first does not.
  And compiler gives an error message :</p>
  
  <blockquote>
    <p>[Error] invalid operands of types 'float' and 'float' to binary 'operator&amp;'.</p>
  </blockquote>