summaryrefslogtreecommitdiff
path: root/time.c
diff options
context:
space:
mode:
authorClay Smith <claysmith158@gmail.com>2023-08-01 01:09:09 -0500
committerClay Smith <claysmith158@gmail.com>2023-08-01 01:09:09 -0500
commit102341d7ae8793c29d44fa416d3b5b797d1eca3e (patch)
tree6df9a5d5ef978dc6809a7d71d50de6e359dae2e7 /time.c
First commitHEADmain
Diffstat (limited to 'time.c')
-rw-r--r--time.c28
1 files changed, 28 insertions, 0 deletions
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 <stdio.h>
+#include <time.h>
+#include <stdlib.h>
+
+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);
+}