C - logical negation: !the logical negation operator is used to determine the oposite value. in our case: if input is true then output is false, and if input is false the result is true. In next table you can find all possibilities:
DescriptionUsed keywords: !
- par1 - logical value
- Result - logical value
Cin the source code you can find the equivalent of the above table, for easier orientation at the end of each line is a comment which shows the result.
a1 = !0; // a1 = true a2 = !1; // a2 = false
Ceven one example in what situations we can use the operation logical negation:
!a !b && 1 !(10 >a || a<5)
COther pieces of example codes:
you can find it in the following collections: logical operators
logical negation in another programming language: