D LanguageLoops


Syntax

  • for (<initializer>; <loop condition>; <loop statement>) { <statements> }
  • while (<condition>) { <statements> }
  • do { <statements> } while (<condition>);
  • foreach (<el>, <collection>)
  • foreach_reverse (<el>, <collection>)

Remarks

You can play with loops and foreach online.