Boolean logicBoolean logic

When designing programs, there are often points where a condition needs to be tested in order to make a decision. Conditions are formed using Boolean logic.

Part ofComputer ScienceProgramming

Boolean logic

is used in to test .

As well as using simple comparison, Boolean logic can also use the AND, OR and NOT:

  • AND considers two (or more) conditions. The result is True if the result of all comparisons is True.
  • OR considers two (or more) conditions. The result is True if either comparison is True.
  • NOT requires a condition to be False.
Image gallerySkip image gallerySlide1 of 3, The Boolean operator AND can be used to narrow or broaden your search results. If the statement is 'Adult AND Male', it will refer to an adult male only., Adult AND male highlights just the man