Zebra0.com

cpp loopsFor loop counts from 10 down to 1

For loop counts from 10 down to 1

In this example, n starts with 10 and counts backwards. It is important to think through the code and make sure that you don't have an endless loop. If we start with 10 and subtract 1 each time, n>=0 will eventually be false and the loop will end.