Home  >  Article  >  Backend Development  >  How to express not equal in C language?

How to express not equal in C language?

尚
Original
2020-03-02 13:31:1475368browse

How to express not equal in C language?

is not equal to the relational operator in C language, its symbol is! =, consisting of two characters, an exclamation point and an equal sign, with no spaces in between.

The usage form is expr1! =expr2. That is, when the values ​​of expr1 and expr2 are not equal, the result is 1 (true), otherwise it is 0 (false).

Recommended: "c Language Tutorial"

"!=" in c language is a relational operator. The relational operators in c language are:

How to express not equal in C language?

Relational operators are all binary operators, and their associativity is left associative. Relational operators have lower precedence than arithmetic operators and higher than assignment operators. Among the six relational operators, , >= have the same precedence, which is higher than == and !=, and == and != have the same precedence.

For more programming related content, please pay attention to the Programming Introduction column on the php Chinese website!

The above is the detailed content of How to express not equal 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