You just need to wrap the code above into a loop that counts the number of tries. Somthing like:
#define MAXTRIES 5 // whatever maximum you decide on
int secret=52, tries=0;
int guess;
for (tries = 0; tries < MAXTRIES; tries++)
{
printf("Enter a guess number between 1 to 100\n");
}
Note that your test for too high and too low are the wrong way round.