Home >Backend Development >C#.Net Tutorial >What does equal to equal mean in c language
The equality operator (==) in C language is used to compare whether the values of two expressions are equal, and returns 1 (true) for equality and 0 (false) for inequality.
Equal to equal operator (==) in C language
In C language, equal to equal to operator (==) is a Boolean operator used to compare the values of two expressions for equality. It returns a boolean value that is true (1) if the expressions are equal, false (0) otherwise.
Grammar
<code class="c">expression1 == expression2</code>
Among them:
expression1
and expression2
are to be compared expression. Return value
expression1
and expression2
are equal, return 1 (true) . expression1
and expression2
are not equal. Example
<code class="c">int a = 5; int b = 5; if (a == b) { printf("a 和 b 相等\n"); } else { printf("a 和 b 不相等\n"); }</code>
Output:
<code>a 和 b 相等</code>
Because the values of a
and b
are both 5, so a == b
is true.
The above is the detailed content of What does equal to equal mean in c language. For more information, please follow other related articles on the PHP Chinese website!