Code:
        for (count = 1; count <= 9; count++)      // generate random number loop digit from 0 -> 9
        {
            num = rand() % limit;
            printf("%d", num);
        }
The code above is only storing one random number (digit) between 0 and 9. E.g. if this produces the sequence 1 2 3 4 5 6 7 8 9 then the user has to enter 9 for the input == num condition to be true.

As for the delay function... I doubt that's doing anything at all and if you turn on optimisation (e.g. compile with, say, -O2 using gcc) then the compiler will optimise the loops away as dead code