Control Structures: Difference between revisions

From Rosetta Code
Content added Content deleted
(→‎Iterative: Removed section)
(Beefed up a bit...encyclopedia articles should have more information)
 
(42 intermediate revisions by 9 users not shown)
Line 1: Line 1:
[[Category:Encyclopedia]]'''Control structures''' are features of programming languages that influence the code flow. Examples of control structures are:
{{task}}
*loops, which repeat sections of code
*conditions, which selectively execute sections of code
*exceptions, which help in error handling and avoid causing more problems when there is another problem
*jumps (a.k.a. "branches" or "gotos"), which explicitly and usually unconditionally set the next instruction to be executed by the program


Examples of these structures can be found on the following pages:
Control structures are features of programming languages that influence the code flow. Two common examples are loops and conditions. The task here is to demonstrate control structures supported by different programming languages.

<font color="#33CC33">This page is being split into multiple articles. Please help move code into these articles, instead:


* [[Conditional Structures]]
* [[Conditional Structures]]
* [[Flow Control Structures]]
* [[Flow Control Structures]]
* [[Loop Structures]]
* [[Loop Structures]]
* [[Exceptions]]</font>
* [[Exceptions]]
* [[Help:Orphaned code]]

Latest revision as of 20:37, 22 October 2008

Control structures are features of programming languages that influence the code flow. Examples of control structures are:

  • loops, which repeat sections of code
  • conditions, which selectively execute sections of code
  • exceptions, which help in error handling and avoid causing more problems when there is another problem
  • jumps (a.k.a. "branches" or "gotos"), which explicitly and usually unconditionally set the next instruction to be executed by the program

Examples of these structures can be found on the following pages: