Home  >  Article  >  Backend Development  >  What symbol is used to represent "and" in C language?

What symbol is used to represent "and" in C language?

烟雨青岚
烟雨青岚Original
2020-06-19 09:56:2051707browse

What symbol is used to represent

#What symbol is used to represent "and" in C language?

#The "and" in C language is represented by the "&&" symbol.

There are three ways of using "&&" in C language.

1, Address operator.

Unary operation, combined with the following variables or constants, is used to obtain the memory address of the operand.

2, Bitwise AND operation in bit operations

binary operator, the expressions on both sides of && are involved in the operation. Calculations are performed bitwise. For any bit, if the value of this bit in both operands is 1, the result will be 1; otherwise, the value of this bit in the result will be 0.

3, When two "&&" symbols are used at the same time, it is the && symbol.

It means to represent the logical AND in logical operations. Binary operator, the expressions on both sides of && are involved in the operation.

What symbol is used to represent and in C language?

The result is true when both sides of && are true. Otherwise the result is false. Since && is a logical operation, the result can only be true (1) or false (0).

Extended information

1. When using &, perform AND operation, the result will generally be the same, but there will also be occasional situations, such as the AND of 10 and 5, that is, 1010&0101, The result is 0, and the result at this time is different.

2. && and || are logical operators. Except for 0, other non-zero integers can be regarded as true. If 10 and 6 are ANDed, the result will be true.

Recommended tutorial: "C Language"

The above is the detailed content of What symbol is used to represent "and" 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