- 1

Why would I ever need the NOT operator?

24th Jul 2016, 2:21 AM
Captain Fach
Captain Fach - avatar
2 Answers
+ 2
it is useful in inversion of result.
27th Jul 2016, 8:36 AM
Gaurav Mittal
Gaurav Mittal - avatar
0
There are plenty uses of not. Sometimes it's just used to check it a value is NOT something, i.e. you don't know what it is but you know that it ain't a particular value such as 0 if (x != 0) A better example is when you needed to reverse the result of a check condition, i.e. if a library function returns 0 if the check condition is true, then you need to use "not" to change the return value i.e 1 for true and 0 for false.
30th Oct 2016, 3:26 PM
Subhabrata Ghosh
Subhabrata Ghosh - avatar