What are Boolean operators and how are they used?

Answer:

Answer

Boolean operators are used in programming. It would be hard for me to explain exactly how they are used in programming without giving you a programming course, but I can tell you basically what they do. The main boolean operators are AND, OR, NOT, and XOR (exclusive or). So:

  • (true AND true) makes true
  • (true AND false) makes false
  • (false AND true) makes false
  • (false AND false) makes false

  • (true OR true) makes true
  • (true OR false) makes true
  • (false OR true) makes true
  • (false OR false) makes false

  • (NOT true) make false
  • (NOT false) makes true

XOR is the same as OR except that it only allows one or the other to be true; not both:

  • '''(true XOR true) makes false'''
  • (true OR false) makes true
  • (false OR true) makes true
  • (false OR false) makes false

Boolean operators can be mixed together like this:

NOT (true XOR (false AND true)) makes false

In programming, you often use symbols to represent these instead of writing out the words. OR is ||, not is !, and AND is &&.

-DJ Craig

Answer

They are often used by search engines.

If you put in "Bob" AND "Smith" you would get results that have both Bob and Smith in them (say 150 results).

If you put in "Bob" OR "Smith" you would get any result with Bob or Smith (say 3000 results).

If you put in "Bob" NOT "Smith" you would get Bob Jones, but not Bob Smith.

Not all search engines use these. And some use other terms for them.

First answer by Frostgiant. Last edit by Frostgiant. Contributor trust: 63 [recommend contributor recommended]. Question popularity: 55 [recommend question].