From 102341d7ae8793c29d44fa416d3b5b797d1eca3e Mon Sep 17 00:00:00 2001 From: Clay Smith Date: Tue, 1 Aug 2023 01:09:09 -0500 Subject: First commit --- time.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 time.c (limited to 'time.c') diff --git a/time.c b/time.c new file mode 100644 index 0000000..4e2dfd3 --- /dev/null +++ b/time.c @@ -0,0 +1,28 @@ +#include +#include +#include + +int main(void) { + + srand(time(NULL)); + + size_t NUMBER = rand() % 5000; + + long long num = 0; + + printf("Guess the number between 0 and 5000\n"); + + while (num != NUMBER) { + printf("Enter guess: "); + scanf("%lld", &num); + + if (num > NUMBER) { + printf("lower\n"); + } else if (num < NUMBER) { + printf("higher\n"); + } + } + + + return(0); +} -- cgit v1.2.1