One Program (For loop, while loop, Do while loop)

Can I make a program together for loop, while loop and do while loop? Please help me . Thanks!
Yes, you can. What do you need help with?

I would like to make the program appear with numbers between 0-10 for loop, while loop and do while loop . Thanks for the help.
For the for loop, you could display the counter as increases while looping.
For example:
1
2
    for (int count = 0; count < MAXNUM; count++) 
	   cout << count << endl;


For the while loop, it would be something like this:
1
2
3
4
5
    while (num < MAXNUM)
    {
	   cout << num << endl;
	   num++; // Use a post-accumulator to keep looping until it reaches the max number.
    }


For the do-while loop, it would be something like this:
1
2
3
4
5
6
    do
    {
	   cout << num << endl;
	   num++;

    } while (num < MAXNUM);


Now, if you notice in the three examples, I use the < and not the <=. It is my personal preference to use the <, which only means that I have to increase the value by one. If I want to loop 800 times, then I have to put the number 801 so includes the number 800, but not 801.
thank you. I already have a program. TY
closed account (48T7M4Gy)
See http://www.cplusplus.com/forum/beginner/179500/
Topic archived. No new replies allowed.