Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 10th, 2012  |  syntax: None  |  size: 0.30 KB  |  hits: 7  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. logical AND and OR in c
  2. 0 &&  0 -> 0
  3.    1 &&  0 -> 0
  4.    1 &&  1 -> 1
  5.    2 &&  1 -> 1
  6.   -1 && -1 -> 1
  7. -100 &&  0 -> 0
  8.  
  9.    0 ||  0 -> 0
  10.    1 ||  0 -> 1
  11.    0 ||  1 -> 1
  12.   -1 ||  0 -> 1
  13. -100 || 20 -> 1
  14.        
  15. Returns 1 if both operands are non zero values
  16.        
  17. Returns 1 if one of the operands is a non zero value