title: How to make countdown timer print result on single line in C?
body: <p>I have code here which works as a countdown timer but it prints results on a new line
  like this:</p>
  
  <pre><code>10
  9
  8
  7
  6
  5
  4
  3
  2
  1
  </code></pre>
  
  <p>here is my code: </p>
  
  <pre><code>int timer()
  {
          int count;
          count = 10;
  
          while(count != 0)
          {
                  printf("Time: \t%d \n", count);
                  count--;
                  sleep(1);
          }
  
          printf("\nCount down timer has expired\n");
          return 0;
  }
  </code></pre>
  
  <p>what I've tried so far is to change \n to \r to print on a single line but it did not work. I'm trying to make it clear the line and print the next number in the line then clear that and print the next one if that makes sense</p>