+ 4
Assume A holds 1 and B holds 0, then -
!(A&&B) is "true" ... Please tell why?
5 ответов
+ 5
Simple
You said a holds 1 and b holds 0 which means a is true and b is false.
now you've given a condition that !(a&&b) which means in English that "neither a nor b should be false" but b is false. Hence finally overall condition is true.
Note that computer always takes 0 as a false and numbers greater than 0 as true. hence a is true and b is false.
+ 24
A&B are of opposite nature ... so its obvious that A&B will return false only
so !(A&&B) will be true
+ 5
!(A&&B)
= !(1&&0)
= !(0) // if any of the operands is 0 in AND operation, then it makes the whole expression 0
= 1 (true)
+ 5
in C "1" is always true.
not (A and B ) =>( A or not B ) => ( A or A ) => (1 or 1 )=> ( true or true ) => true .
Note : "=>" means implies .
hope this helps :).
+ 3
(A&&B)is false because b is 0
or one of tem is false (0).
but !(logical not operator ) is used to reverse the state so it makes it true