c - Evaluation of this statement -


i reading c book , don't understand statement asking me evaluate.

here statement, !(1 && !(0 || 1))

i can understand things here... have far, not(1 , not(0 or 1))

so it's not 1 , not 0 or 1? or not 1 , 0 or 1? 2 ! cancel each other out double negative? answer true expected false.

can explain?

  1. (0 || 1) == 1
  2. !1 == 0
  3. 1 && 0 == 0
  4. !0 == 1 known true :)

keep in mind || , && short circuit operators, in case still have evaluate right side because operators not short circuit


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -