I need to combine 3 bools to test for the entire truth table (8 combinations) in c++.
I have 2 special cases that need to be attended to, they are a, b and c are all true, and a, b are true but c is false.
The rest don't need to be catered for specifically (they will work automatically together without case-specific instructions)
is there a way to only test for these two cases, and then the individual cases but still allow the individuals to work together?
Such as,
if(a && b && c)
and if(a && b && !c)
then if a, if b, if c respectively
I think it uses if else, but I'm having no luck, the way I have it now performs some operations twice as "a" is true in a b c, a b !c and also in a.
I hope this is clear enough, my first time posting here so apologies if it is not.