//Loops(1) Solution Ex 4 Extra 2

#include <stdio.h>
#define NUMBER 6
void main()
{
	int guess=0;
	int x = 0;

	printf("I am thinking of a number...\n");
	printf("Try to guess what it is...it's between 1 and 10\n\n");

	while (guess != NUMBER && x<3)
	{
		printf("\nEnter your guess: ");
		scanf("%d", &guess);

		if (guess != NUMBER)
		{
			printf("Don't be silly");
			printf("\nSorry that was wrong.");
		}
		x++;
	}
	if (x == 3)
	{
		printf("\n\nOut of tries\n");
	}
	else
	{
		printf("You got it!\n");
	}
}