c 2b 2b progress bar

Solutions on MaxInterview for c 2b 2b progress bar by the best coders in the world

showing results for - "c 2b 2b progress bar"
Victoire
26 Aug 2017
1        cout << "[";
2        int pos = value;
3        for (int i = 0; i < 100;i++) {
4            if (i < pos)
5            {
6                cout << "=";
7            }
8            else if (i == pos)
9            {
10                cout << ">";
11            }
12            else
13            {
14                cout << " ";
15            }
16        }
17
18        cout << "] " << int(value) << " %\r";
19        cout.flush();