ITTERATION
- In C++ there are structures called loops which are used to repeat parts of the code
- until a particular condition is met.
- It must have a counter in order to identify the number of iterations that will take place.
WHILE LOOPS
- While loops only have the condition within the loop declaration, therefore the block of code needs to contain the implementation of the counter.
while(i< n)
{
if i is less than n then do that;
i++;
}
FOR LOOPS
- For loops which test the condition inside the loop
e.g. for (inti = 0; i< n; i++)
{
if i is less than n then do this instruction;
};