summaryrefslogtreecommitdiff
path: root/wk1/compare.c
diff options
context:
space:
mode:
Diffstat (limited to 'wk1/compare.c')
-rw-r--r--wk1/compare.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/wk1/compare.c b/wk1/compare.c
new file mode 100644
index 0000000..8511597
--- /dev/null
+++ b/wk1/compare.c
@@ -0,0 +1,21 @@
+#include <stdio.h>
+#include <cs50.h>
+
+int main(void)
+{
+ int x = get_int("What's x? ");
+ int y = get_int("What's y? ");
+
+ if (x < y)
+ {
+ printf("x is less than y\n");
+ }
+ else if (x > y)
+ {
+ printf("x is greater than y\n");
+ }
+ else
+ {
+ printf("x is equal to y\n");
+ }
+}