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.
Boolean logicA form of logical algebra which works only with two values, true or false. is used in selectionA decision within a computer program when the program decides to move on based on the results of an event. to test conditionIn computing, this is a statement or sum that is either true or false. A computation depends on whether a condition equates to true or false..
As well as using simple comparison, Boolean logic can also use the expressionA combination of symbols representing a value. Expressions are used in programming languages and applications.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.
Slide 1 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