loopsFor loops


Syntax

  • for(init; condition; increment){ content_code(); } // general syntax
  • for(int i = 0; i < numberRuns; ++i){ actions_with(i); } // run an action for a numberRuns times
  • for(int i = 0; i < sizeof(array); ++i){ actions_with(array[i]); } // iteration over an array