Created
September 30, 2025 11:18
-
-
Save juanfal/76566c2a8b53e55d478f837467f9a3ae to your computer and use it in GitHub Desktop.
de morgan 2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 05.demorgan2.cpp | |
// juanfc 2025-09-30 | |
// | |
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
cout << boolalpha; | |
const int A = 2; // we don't need them global | |
const int B = 3; | |
const int C = 2; | |
bool found = false; | |
cout << "not ( ( " << found << " and ( " << A << " == " << B << " )) or ( " << A << " == " << C << " ) ) -> "; | |
cout << boolalpha << (not ( (found and (A == B)) or (A == C) )) << endl; | |
cout << "not ( " << found << " and ( " << A << " == " << B << " )) and not ( " << A << " == " << C << " ) -> "; | |
cout << boolalpha << (( not (found and (A == B)) and not (A == C) )) << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment