|
Re: Simply question about C program
I like to think of AND as a multiplication and OR as an addition. The analogy breaks down with negation though.
So you can think of A && B || (C && D) as A * B + (C*D) which is pretty easily solved by plugging 1 in for true and 0 in for false. 1*0+(1*1) = 1 (assuming A = 1, B = 0, C = 1, and D = 1)
I have to rely on tricks like this because I struggle to do boolean stuff for some reason. Figured I'd share the trick.
__________________
.
|