for(int i = 0; i < 100; i++)
{
printf("%d", i);
}
prints the numers 0-99 behind each other. So 0123456....
However, we would like to see only one number and the previous number is overwritten. We can achieve this by returning the carriage back to the beginning of the current line. This can be done with \r.
Thus
for(int i = 0; i < 100; i++)
{
printf("%d\r", i);
}