#include <stdlib.h>
#include <stdio.h>
#include <time.h>
 
int main(){
	int i, number, Guess, Max = 5 ;
	srand(time(NULL));
	number = rand() % 20;
	
	for (i=0; i<Max; i++) {
		printf("I am thinking of a number between 1 and 20.\n");
		printf("Can you guess what it is? \n");
		scanf("%i", &Guess);
		
		if(Guess == number) {
			
			printf("Congratulations! You guessed the number correctly!");
			return 0;
			
		}
		
		else if (Guess > number) {
			
			printf("Your guess was too high! \n");
			
		}
		
		else if (Guess < number) {
			
			printf("Your guess was too low! Guess again! \n");
		}
	}
	
	printf("Sorry you have entered the maximum amount of tries!");
	printf("The correct guess was %i", number);
	
	return 0;
}