Home  >  Article  >  Backend Development  >  What does && mean in C language

What does && mean in C language

hzc
hzcOriginal
2020-07-01 16:42:5750866browse

In the C language, && is a binary operator that represents the AND operation. When the expression or variable given on the left is 0, the right side is no longer calculated and the entire expression is zero.

What does && mean in C language

"&&" means and, which means to be satisfied at the same time.

"||" means or, meaning two or more as long as one of them is satisfied.

What does && mean in C language

In C language, && and || are both logical operators, and they are both binary operators.

There are three logical operators in total, namely "&&", "||" and "!". a && b, if one is false, it must be false, and the associativity is from left to right. || is the logical OR operator, a || b, if one is true, it must be true, and the associativity is from left to right.

&& and || are logical operators in Java, PHP and c#, also called conditional operators.

Extended information:

In C language && is a binary operator, which represents AND operation. When the expression or variable given on the left is 0, The right-hand side is no longer evaluated, and the entire expression is zero.

Logical operators are used to judge whether a thing is "established" or "not established", or "true" or "false". The result of the judgment has only two values, which is represented by a number as "0" ” and “not 0”.

Among them, "non-0" means that the result of the logical operation is "true", and "0" means that the result of the logical operation expression is "false".

Recommended tutorial: "c Language Tutorial"

The above is the detailed content of What does && mean in C language. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn