+ 3
Somebody help me in Boolean logic under (not) seem hard to me please help
6 Respostas
+ 18
!true = false !!false=true
!!!false=true !!!false = false
//when we use && , then all expression must be true for returning true as final answer
//when or , then even if any one expression returns true , then final answer will return true else false
//example ::: (true && false) =false ,
(true or false) =true
//for even number of !'s , its the boolean value itself bcz all !'s get neutralised
//for odd number of !'s , its the reverse of boolean value
//hope it helps âș
+ 3
"Not" simply mean invert. True is false: false is true.
+ 1
what do you need help with
+ 1
He said he didn't understand what "not" means
+ 1
so you would use not for when you need it to be swapped so if you use 1=2 it would be false but if you use not 1=2 then it would be true
- 1
@Richard Wambogo
Sometimes not is much simpler to write:
For example if you want to execute a statement if a character is anything but âaâ or âzâ. How would you write that?
If (x==âbâ)or(x==âcâ)or...(x==âyâ)
Or you can write
If not ((x==âaâ)or(x==âzâ))
This is the same as:
If (x!=âaâ) and(x!=âzâ)
Or if for example you had 2 conditions x can be anything but âaâ and y can be anything but âzâ.
Isnât the following simpler:
If not ((x==âaâ)and(y==âzâ))