summaryrefslogtreecommitdiff
path: root/tests/logical.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/logical.c')
-rw-r--r--tests/logical.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/logical.c b/tests/logical.c
new file mode 100644
index 0000000..6bd1018
--- /dev/null
+++ b/tests/logical.c
@@ -0,0 +1,14 @@
+int main() {
+ int a = 1;
+ int b = 0;
+ int c = 1;
+
+ int and1 = a && b;
+ int and2 = a && c;
+ int or1 = a || b;
+ int or2 = b || b;
+ int not1 = !a;
+ int not2 = !b;
+
+ return and1 + and2 + or1 + or2 + not1 + not2;
+}