I was just wondering how some programs update certain parts of the terminal output.... Like when showing the percentage done. Its hard to explain...

Like if the output was this:
Qt Code:
  1. Percentage: [number]
To copy to clipboard, switch view to plain text mode 
Where [number] was continuously updated.

How is that done?

Thanks