Number guessing game in C
This looks quite good code.  You've avoided many of the common mistakes.

Here are the things I spotted as I walked through.  Most of them are quite minor; the only serious issue is the handling of invalid user input.




srand(time(0));



Don't do this every time you want a random number - a random number generator is intended to be seeded just once.  So move the srand() call to the beginning of `main().

(Yes, I know this program calls generate_random_number() only once.  But we shouldn't need to have that knowledge, and we might want to change that behaviour, or to re-use this function in another program.)




// this function stops the program until useless input is entered



What's the point?  That just annoys the user, who would naturally expect to be returned to their shell after executing a program.  This just makes it look like the program is not responding.  Also, the useless variable is unnecessary - add the * modifier to the %i conversion to inhibit assignment.




int main()



This says that main() can be called with an unspecified number of arguments.  Instead, prefer to explicitly declare that it takes no arguments:

int main(void)





printf("You have to guess a number between 1 and 99.\n");



When the output is a fixed string ending in newline, we can use puts() instead of printf().




    int guess;
    scanf("%i", &amp;guess);



If something that's not a number is entered, then scanf() will fail and guess will be uninitialized (that's Undefined Behaviour, which is Not A Good Thing).  We really, really need to check that scanf() successfully converts 1 input, and take some recovery action if not:

int status;
while ((status == scanf("%i", &amp;guess)) != 1) {
    if (status == EOF) {
        fprintf(stderr, "Read error!\n");
        exit 1;
    }
    scanf("%*[^\n]");  // discard input
    printf("? &gt;");
}


Correctly handling input (and, in particular, unexpected input) is difficult in C!




    else if (guess == random_number)



The if is redundant here, as we've eliminated all other possibilities.  So that can be simply else.