How to display "Loading..." with having 3 dots animating?

closed account (jNhkoG1T)
You may have seen in many places "Loading..." where the 3 dots(or more), viz. "...", first appear one by one, then after displaying all the dots, they again disapperar and once again appear one by one (so, total 2 times).

To elaborate:-
Loading.


Loading..


Loading...


Then, it repeats second time!


So, for this I prepared a program and its source code is:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include<iostream.h>
#include<dos.h>
#include<conio.h>
void main()
{      clrscr();
	cout<<"Loading";
	for(int i=0; i<3; i++)
	{
	       for(int i=0; i<2; i++)
	       {
			sleep(2);
			cout<<".";
		}
	 }
}


This program runs successfully, but it repeats the second set of dots without clearing the first 3 dots.



But in this code, I didn't get how to display the animation of dots second time with having disappearing all the three dots that appeared first time!

Can you guys, please help me out? :)

Thanks, in advance! :)
Topic archived. No new replies allowed.