for statements

Loops through the values of i, from the first to the last by the increment specified. Useful when used in combination with arrays to operate on collections of data/pins.

Important Note: In C you don’t need to initialise the local variable i. You can do it directly in the for statement itself. This is different in other, java based languages.

Example

for (int i=1; i <= 8; i++){
  statement using the value i;
} 

Reference Home