Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Control flow
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Execution order of computer commands}} {{Distinguish|Flow control (data)}} {{Loop constructs}}<!-- DO NOT remove. Discuss navigation concept at [[Talk:Do while loop#Helpbox experiment]] --> In [[computer science]], '''control flow''' (or '''flow of control''') is the order in which individual [[Statement (computer science)|statements]], [[Instruction (computer science)|instructions]] or [[function call]]s of an [[imperative programming|imperative]] [[computer program|program]] are [[Execution (computing)|executed]] or evaluated. The emphasis on explicit control flow distinguishes an ''[[imperative programming]]'' language from a ''[[declarative programming]]'' language. Within an imperative [[programming language]], a ''control flow statement'' is a statement that results in a choice being made as to which of two or more paths to follow. For [[Strict programming language|non-strict]] functional languages, functions and [[language construct]]s exist to achieve the same result, but they are usually not termed control flow statements. A set of statements is in turn generally structured as a [[Block (programming)|block]], which in addition to grouping, also defines a [[lexical scope]]. [[Interrupt]]s and [[Signal (computing)|signals]] are low-level mechanisms that can alter the flow of control in a way similar to a [[subroutine]], but usually occur as a response to some external stimulus or event (that can occur [[Asynchronous systems|asynchronously]]), rather than execution of an ''in-line'' control flow statement. At the level of [[machine language]] or [[assembly language]], control flow instructions usually work by altering the [[program counter]]. For some [[central processing unit]]s (CPUs), the only control flow instructions available are conditional or unconditional [[Branch (computer science)|branch]] instructions, also termed jumps.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)