May 15, 2021 Arduino
The judgment structure requires the programmer to specify one or more conditions to evaluate or test by the program, as well as statements to execute when the condition is true (required) and statements to execute when the condition is false (optional).
The following is a general form of judgment structure typical of most programming languages:
A control statement is an element of the source code that controls the execution process of a program. They are:
Serial number | Control statements and descriptions |
---|---|
1 |
It takes an expression in parentheses, followed by a statement or block of statements. /b10> If the expression is true, execute statements or blocks of statements, otherwise skip them. |
2 |
An if statement can be followed by an optional else statement, which is executed when the expression is false. |
3 |
If ... e lse if ... Else statement The if statement can be followed by an optional else if ... Else statement, which is useful for testing various conditions. |
4 |
Similar to an if statement, switch ... Case controls the process of a program by allowing the programmer to specify different codes that should be executed under various conditions. |
5 |
Conditional operator? ge. |