do while loop

For this do while loop, I want to display this output (1,2,1,3,1,4,1,5) without changing the value of m.

1
2
3
4
5
6
7
8
9
10
11
12
        m=0;
	do
        {
	if (m>2)
        {
	cout <<", ";
        }
        if (m<0)
        continue;
        cout <<1<<","<<m;
        m++;
        } while (m<6);
Last edited on
Topic archived. No new replies allowed.