APSC 160 Chapter Notes - Chapter 4.4: Negation, Logical Connective, Logical Conjunction
Document Summary
The last logical operator is not operator which negates everything. That is if it"s true it returns false and vice versa. So if it is !true, it returns false. If it is !false, it returns true . basically, it just reverses it. If we use example a = 4, b = 6 , and we write it in a way , ! (a == 6 && b == 8) , the result logical not operator returns in true. And is false and not operator negates it or reverses it. There are some more operators which are of different use. C programming language helps us to make decision by using if- else statement. If explained in laymen terms, conditions are evaluated and based on condition whether true or false, that condition is executed. For example, if it"s raining then we will stay at home else we will go outside. In programming language this is written in the following way: