Created
September 30, 2025 10:40
-
-
Save juanfal/ef25f6205851e1351f35cbc000fa055b to your computer and use it in GitHub Desktop.
booleans!
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
// 01.booleans.cpp | |
// juanfc 2025-09-24 | |
// | |
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
cout << "true and true -> " << (true and true) << endl; | |
cout << "false and true -> " << (false and true) << endl; | |
cout << "1 == 1 and 2 == 1 -> " << (1 == 1 and 2 == 1) << endl; | |
cout << "1 == 1 or 2 != 1 -> " << (1 == 1 or 2 != 1) << endl; | |
cout << "true and 1 == 1 -> " << (true and 1 == 1) << endl; | |
cout << "1 != 0 and 2 == 1 -> " << (1 != 0 and 2 == 1) << endl; | |
cout << "not (true and false) -> " << (not (true and false)) << endl; | |
cout << "not (1 == 1 and 0 != 1) -> " << (not (1 == 1 and 0 != 1)) << endl; | |
cout << "not (10 == 1 or 100 == 100) -> " << (not (10 == 1 or 100 == 100)) << endl; | |
cout << "not (1 != 10 or 3 == 4) -> " << (not (1 != 10 or 3 == 4)) << endl; | |
cout << "1 == 1 and not (1 == 1 or 1 == 0) -> " << (1 == 1 and not (1 == 1 or 1 == 0)) << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment