summaryrefslogtreecommitdiff
path: root/time.c
blob: 4e2dfd3985ed9e9cef8850bae4294970c0b7f60a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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);
}