Here's the initialization condition is first set to a=10. The loop first checks for this condition. It then checks for the condition expression ie a<20 which holds true as 10<20(for the first case). Now the body of the loop is executed and we get the output "Value of a: 10". Then the update expression is executed which adds the number 1 to 'a' and the value of 'a' gets updated to 11 and the same steps are followed (as above) until the value of v reaches less than 20 ie 19.
# Range-based for-loop
C++ also has what we call range-based for loops which iterates through all the elements of a container(eg array).
## Syntax
```
for(element:container) 声明(S); }
int \[5\] array = {1,2,3,4,5} for(int i:array) cout << i << endl; }