- One thing that computers are especially good at is doing things over and over. For instance, Lets say we wanted to print out the numbers zero to nine:
for(int i = 0;i < 10;i++) { cout << i << endl; }
- What we do here is define an integer, Say "Keep running as long as its less than 10", Run the code, And add one to the number.