![]() ![]() If the value of theĬondition equals " true", then the following lines of code are executed, up to the start of the "ELSE"-branch or the "END"-statement. In the "if" statement, the condition directly after the statement isĬhecked and its boolean value is calculated. The syntax varies in different programming languages, but the main principle is the same: The condition term usually follows the "if" statement and is calculated only once, right at the start of the control structure. In if-then-else control structures, code is split up into two parts, unless the "else" part is not necessary for the program. If-then-else branching control structures There are two common types of branching control structures: With branching control structures code contained inside the control structure is either executed or not, based on the calculation of a condition. These often produced programs which were difficult to understand and to debug. There are two main types of control structures:īoth kinds of control structures help to avoid the classic jump commands like "GOTO" which were common in earlier programming languages. These commands control which part of the program the computer will execute next. What is a control structure and how can it be used when you are writing programs? Read on to find out.Ĭontrol structures are specific commands in imperative programming languages which are used to control the logical flow of the program during its execution. Programming Terminology: Control structure
0 Comments
Leave a Reply. |