#include #include using namespace std; void print_and(bool, bool); void print_or(bool, bool); void print_xor(bool, bool); void print_compars(int one, int two); int main () { bool done, avalue = true, work = false; int a,b; cout << "Avalue = " << avalue << endl; cout << "work = " << work << endl; done = 5; cout << "done = " << done << endl; cout << "False is " << false << endl; cout << "true is " << true << endl; cout << "False is " << false << endl; cout << "true is " << true << endl; cout << "A B A and B" << endl; print_and(false,false); print_and(false,true); print_and(true,false); print_and(true,true); cout << endl; cout << "A B A or B" << endl; print_or(false,false); print_or(false,true); print_or(true,false); print_or(true,true); cout << endl; cout << "A B A xor B" << endl; print_xor(false,false) ; print_xor(false,true) ; print_xor(true,false) ; print_xor(true,true) ; cout << endl; print_compars(1,2); print_compars(2,2); print_compars(2,1); } void print_and(bool a, bool b) { cout << a << " " << b << " " << (a && b) << endl; } void print_or(bool a, bool b) { cout << a << " " << b << " " << (a || b) << endl; } void print_xor(bool a, bool b) { bool xxor; xxor = ((a && !b) || (!a && b)); cout << a << " " << b << " " << xxor << endl; } void print_compars(int one, int two) { cout << "one = " << one << " two = " << two << endl; cout << one << " == " << two << " is " << (one == two) << endl; cout << one << " >= " << two << " is " << (one >= two) << endl; cout << one << " <= " << two << " is " << (one <= two) << endl; cout << one << " != " << two << " is " << (one != two) << endl; cout << one << " > " << two << " is " << (one > two) << endl; cout << one << " < " << two << " is " << (one < two) << endl; cout << one << " = " << two << " is " << (one = two) << endl; cout << endl; }