Truth Table [Help me]

Our teacher told us to make a program about truth table.


condition 1 condition 2
false false = false
false true = false
true false = false
true true = true

how to write this on c++ program?
I'm not sure what exactly your teacher wants.

Though , your truth table looks like the truth table of AND operation.
See : http://en.wikipedia.org/wiki/AND_gate

In C++ you can use the && logical operator.
e.g.
1
2
3
bool A,B;
//input or give them some value
bool C = A && B;
Last edited on
Thank you sir! :)
Topic archived. No new replies allowed.