// Prog: assertion2.cpp // use assertions to check De Morgan's laws. To tell the // compiler to ignore them, #define NDEBUG ("no debugging") // at the beginning of the program, before the #includes #define NDEBUG #include int main() { bool x; // whatever x and y actually are, bool y; // De Morgan's laws will hold: assert ( !(x && y) == (!x || !y) ); // ignored by NDEBUG assert ( !(x || y) == (!x && !y) ); // ignored by NDEBUG return 0; }