/*
The first: If a conditional expression is set, execute the parentheses after the curly braces
if (conditional expression) {
Statement
...
}
The second type: if the conditional expression is true, execute if the statement in curly braces after the parentheses is executed, or else the statement in the curly braces after the
At least one code here will be executed
if (conditional expression) {
Statement
...
}else{
Statement
...
}
The third type:
if (conditional expression) {
Statement
....
}else if (conditional expression 2) {
Statement
....
}else if (conditional expression 3) {
Statement
....
}
....
else{
Statement
....
}
Features: 1. Only one block of code can be executed in so many blocks
2. When the program executes the conditional expression 3, it indicates that all the expressions in front of it are not valid.
3. If there is else in the IF statement then a block of code will be executed to
Features of the IF statement:
If statement: 1, both are the IF start
2. There can be any other else if
3. There can be at most one else statement
4. If there is only one statement following the IF statement, the curly braces after the if can be omitted (usually development is not done)
If nesting: If statements can be nested inside other if statements
Summary: If statement is also a statement, as long as can write the statement where can write if statement
if (conditional expression) {
Statement
..
if (conditional expression) {
Statement
...
}
Statement
....
}
*/
C Language: If statement