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.