Current location - Training Enrollment Network - Mathematics courses - = =, & amp& amp‖ What do you mean?
= =, & amp& amp‖ What do you mean?
The equal sign operator in relational operators is represented by two equal signs "= =".

&&:An AND operator that concatenates two expressions into one expression. Both expressions must be true for the whole expression to be true. These two expressions connected by logical and operators are complete expressions, and their values can be evaluated as true or false. Finally, these two results are juxtaposed by AND to get the final result of the whole expression.

||: Yes or operator, which connects two expressions into one. For the whole expression to be true, one or two expressions must be true. As long as one of them is true, the other one becomes irrelevant. As long as one of these two sub-expressions is true, the whole expression is true and the cout statement is executed.

Extended data

Logical operators are usually used for Boolean (logical) values. In this case, they return a Boolean value. However & The and ||| operators return the values of the specified operands, so these operators are also used for non-Boolean values. At this point, they will also return a non-Boolean value.

Although & The and ||| operators can use non-Boolean operands, but they can still be regarded as Boolean operators because their return values can always be converted into Boolean values. If you want to explicitly convert their return values (or expressions) to Boolean values, use the double NOT operator (that is! ! ) or Boolean constructors.

Baidu encyclopedia-&&;

Baidu encyclopedia-