Template:Computer Programming/Control/1

From Wikibooks, open books for an open world
Jump to: navigation, search

[edit] Conditionals

Conditional clauses are blocks of code that will only execute if a particular expression (the condition) is true.

[edit] if-else

The if-else statement is the simplest of the conditional statements. They are also called branches, as when the program arrives at an if statement during its execution, control will "branch" off into one of two or more "directions". An if-else statement is generally in the following form:

Personal tools
Namespaces
Variants
Actions
Navigation
Community
Toolbox
Sister projects