Current location - Training Enrollment Network - Mathematics courses - Three operation rules of "AND or NO"
Three operation rules of "AND or NO"
There are three kinds of AND or NOT operation rules: AND operation rules, or operation rules and NOT operation rules.

I. Operating rules

1 and operation definition

The result of AND operation is true if and only if both operands are true. Represented by mathematical symbols, A and B = true, if and only if A = true and B = true.

2. Application scenarios

And operation is used in many occasions, such as programming, for conditional judgment and data verification. Only when all conditions are met can the result of AND operation be true.

Step 3: Example

In programming languages, such as C or Java, "&; & symbol representation and operation. if(a = = b & amp; & ampb = = c) {/dosomething} means that the code in braces is executed only when A equals B and B equals C.

Second, it is still the operating rules.

1, or operation definition

As long as one operand is true or the result of the operation is true. Expressed by mathematical symbols: a or B = true, if and only if A = true or B = true.

2. Application scenarios

Or operation has applications in many occasions, such as process control in programming and signal processing in electronic engineering. As long as there are qualified signals, or the operation result is true.

Step 3: Example

In programming languages, such as C or Java, the symbol || is used to indicate or operate. Such as if(a==b||b! =c){//do something} means that as long as A is equal to B or B is not equal to C, the code in braces is executed.

Third, non-operational rules.

1, the definition of non-operation

NOT operation is a unary operation, which inverts the true value. If the operand is true, the result of the NOT operation is false; Conversely, if it is false, the result is true. Expressed by mathematical symbols: non-a = true if and only if A = false; NOT A=FALSE if and only if A=TRUE.

2. Application scenarios

Non-operation has many applications, such as logic control in programming and signal inversion in electronic engineering. The inverse control of conditions can be easily realized by NOT operation.

Step 3: Example

In programming languages, such as C or Java, use "!" Symbol means not running. If if (! A){//do something} means that if a is false (or the condition is not met), the code in braces is executed.