#include <stdio.h>
#include <stdlib.h>	//standard library
#include <time.h>	//time library

void main()
{
int cnumber=0,guess=0,noofguesses=0;
int low=1;
int high=10;

srand(time(NULL));
cnumber=rand()%(high-low+1)+1;

printf("I am thinking of a number...\n\n");
printf("Try to guess what it is...it's between 1 and 10\n\n");

while(guess!=cnumber)
{
printf("Enter your guess");
scanf("%d",&guess);
noofguesses++;
}

printf("Well done. ");
printf("You took %d guesses",noofguesses);
printf("\n\n");
}