summaryrefslogtreecommitdiff
path: root/time.c
diff options
context:
space:
mode:
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);
+}