The simpler choice, if you want to keep it on a single line, would be to use \r
.
Printing \r
will move your cursor to the beginning of the line, giving you the ability to print hover the old characters.
A solution would look something like
for (i = 0; i < 100; ++i)
{
printf("\r%3i%%", i);
fflush(stdout);
/* ... */
}
If you need more advanced control over the terminal, you can use termcaps.