For Loops in C++

The for loop is the counting loop of C++. It is usually designed to run a specific number of times, and then end. With it, it keeps a counter, to let you know where in the loop you are – useful when looping through an array which will look at soon enough. The general form…

The C++ Do-While Loop

The Do-While loop is similar to the while loop. It is a conditional loop, just like the while loop, running the body of the loop while the condition is met. However, the big difference is that the do-while loop is a post-test loop. That means that the body runs at least once, and then there…