/*
Lauren Dukes
CPSC 1110 Example

The computer is thinking of a number between 1 and 10.
Using a while loop, the program lets the user guess until they get it right.
*/

#include <stdio.h>

int main (void){
	//have the computer pick a number
	int x = 4;

	//declare a variable to hold the user guess
	int guess = 0;

	//get the user's first guess
	printf("I'm thinking of a number between 1 and 10. Guess what it is: ");
	scanf("%d",&guess);

	//while they haven't guessed it
	while (guess != x){
		//get them to guess again
		printf("Nope! Guess again: ");
		scanf("%d",&guess);
	}

	//now that guess == x, that means that the user got it right
	//let them know that
	printf("You guessed it!\n");

	return 0;
}

