There are following logical operators supported by C language
Operator Description Example
== Checks if the value of two operands is equal or not, if yes then condition becomes true. (A == B) is not true.
!= Checks if the value of two operands is equal or not, if values are not equal then condition becomes true. (A != B) is true.
> Checks if the value of left operand is greater than the value of right operand, if yes then condition becomes true. (A > B) is not true.
< checks if the value of left operand is less than the value of right operand, if yes then condition becomes true. (a < b) is true.
>= Checks if the value of left operand is greater than or equal to the value of right operand, if yes then condition becomes true. (A >= B) is not true.
<= checks if the value of left operand is less than or equal to the value of right operand, if yes then condition becomes true. (a <= b) is true.
&& called logical and operator. if both the operands are non zero then then condition becomes true. (a && b) is true.
|| called logical or operator. if any of the two operands is non zero then then condition becomes true. (a || b) is true.
! called logical not operator. use to reverses the logical state of its operand. if a condition is true then logical not operator will make false. !(a && b) is false.
Syntax:operand < \ > \ != \ == operand
Example:if(a>b){
/*code goes here*/
}
License.
All information of this service is derived from the free sources and is provided solely in the form of quotations.
This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 443 / 158778457. Delta: 0.01865 с