6 If and ELSE statements
The If-else statement should have the following format:
if (condition) {/* conditions to operate on */
statements;
}
if (condition) {/* The condition of the operation. */
statements;
} else {/* conditions for Operation */
statements;
}
if (condition) {/* conditions to operate on */
statements;
} else if (condition) {/* conditions to operate on */
statements;
} else{/* conditions of operation */
statements;
}
NOTE: The If statement is always enclosed in "{" and "}", avoiding the following formatting that is prone to error:
if (condition)//Avoid this notation, he ignores "{}"
Statement
Note Formats can also be written in this way as follows
if (condition) {
/* Conditions for Operation */
statements;
} else {
/* Conditions for Operation */
statements;
}
As long as you can describe the relationship between the branches, where to write the comments can be
http://www.bkjia.com/PHPjc/532590.html www.bkjia.com true http://www.bkjia.com/PHPjc/532590.html techarticle The If-else statement for the 6 if and ELSE statements should have the following format: if (condition) {/* The condition to operate on */statements;} if (condition) {/* for operation. */statements;} else ...