1. What is process control of a program?
1. Syntax format
18) {// a relational operator is involved here
The above program is to judge whether the user input age is greater than or equal to 18. If the result is true, enter the adult result on the console; otherwise, execute the statement in else, the output has no adult results, and the above program is not rigorous. For example, the user is not judged for illegal characters, but here I only want to explain the use of the if and else syntax, those will be ignored and will be analyzed in detail when exceptions are mentioned;
Comparison operators (also known as Relational operators ):
This is the same as the judgment in mathematics, but the symbol here has changed. It should be noted that the equal operator is "=" rather than "= ", this "=" is a value-assigned symbol in c #, which is easy to make mistakes when making judgments;
Conditional boolean operator:
Here is a note, that is, the difference between logic and, or, and short-circuit and, or: As long as either side of the operand is false, the value of the entire expression is false, so when it is determined that the left side of the expression is false, short circuit and will no longer judge the value of the right side operand, whether it is true or false, because the result has come out; short circuit or the same, as long as the expression is true on the left, it makes no sense to judge down; so in actual use, both short and, or are used.
2. deformation format
3. switch, case structure usage
1. Syntax format
2. default rules
4. Use of loop statements
1. while Loop
// Note that there is a semicolon, which cannot be used.
4. Loop other end Methods