From 6a10c33f6e59de7f02fd6c12bce308d3150c5eeb Mon Sep 17 00:00:00 2001 From: Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> Date: Sun, 3 Dec 2023 05:51:36 +0000 Subject: Sat, Dec 2, 2023, 9:51 PM -08:00 --- wk1/lect1/compare.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 wk1/lect1/compare.c (limited to 'wk1/lect1/compare.c') diff --git a/wk1/lect1/compare.c b/wk1/lect1/compare.c new file mode 100644 index 0000000..8511597 --- /dev/null +++ b/wk1/lect1/compare.c @@ -0,0 +1,21 @@ +#include +#include + +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"); + } +} -- cgit v1.2.3