Control Structures
These are examples of control structures. You may also be interested in:

 Conditional structures
 Exceptions
 Flow-control structures
 Loops

Task

List the conditional structures offered by a programming language. See Wikipedia: conditionals for descriptions.

Common conditional structures include if-then-else and switch.

Less common are arithmetic if, ternary operator and Hash-based conditionals.

Arithmetic if allows tight control over computed gotos, which optimizers have a hard time to figure out.



 
Module CheckIt {
      Read a
      If a>1 then {
            Print "Top"
      } else.if a>=-4 then {
            Print "Middle"
      } else {
            Print "Bottom"
      }
}
CheckIt 100
CheckIt 0
CheckIt -100
 
Module CheckIt {
      Read a
      \\ using end if without blocks
      If a>1 then
            Print "Top"
      else.if a>=-4 then
            Print "Middle"
      else
            Print "Bottom"
      End If
}
CheckIt 100
CheckIt 0
CheckIt -100
 
Module CheckIt {
      Read a
      \\ without use of END IF in one line
      If a>1 then Print "Top" else.if a>=-4 then Print "Middle" else Print "Bottom"
}
CheckIt 100
CheckIt 0
CheckIt -100
 