Stage C [02] and [02]
Knowledge focus:
- Boolean Type
- Relational operators
- Logical operators
- If statement
- Enumeration type
- Switch statement
1. boolean BOOL type
It is used to store "true" or "false", and only YES and NO values are changed. YES (1) indicates that the expression result is true, and NO (0) indicates that the expression result is false.
If the value is not 0, it is true.
Ii. Relational operators
It is mainly used for comparison operations. The comparison result is only true or false, and the result value is stored with the BOOL type.
Greater than:>; greater than or equal to: >=; less than: <; less than or equal to: <=; equal to: =; not equal :! =.
Iii. logical operators
Logic and (&)-And: True, false;
Logic or (|) --- or: same false, true or false;
Non-logical (! )-On the contrary, false indicates true or false;
IV. if statement
The if statement can be used to construct a branch structure. It is determined based on the given conditions, and the explain statement decides to execute the program segment of a branch.
Supplement: Conditional operator-three-object Operator