4.2 Item Selection Statements"Teacher, did I pass the level four exam?" ”If the teacher is asked this question, how will he answer? Yes, he will choose different answers according to different conditions:If the test result is greater than or equal
4.2 Item Selection Statements"Teacher, did I pass the level four exam?" ”If the teacher is asked this question, how will he answer? Yes, he will choose different answers according to different conditions:If the test result is greater than or equal
Conditional comments work as follows:
Copy codeThe Code is as follows: Special instructions for IE 6 here
[Code]
Their basic structure is the same as an HTML comment (). Therefore all other browsers will see them as normal comments and will
First, simple if condition statementA conditional expression in a special statement block called a branching structure controls which statements in the program are executed and what execution order is performed. "If ..... Then The branch structure
Conditional executionIn the previous sections we described how to define data and perform basic operations, and in order to have a thorough understanding of the data, we introduced a binary representation of various types of data.Now, let's review
Basic grammatical structure of if single branch
if (conditional expression) {
Execute the statement;}
If Double BranchBasic grammatical structure
if (conditional expression) {Execute the statement;
}else{Execute the statement;
}
If multiple
If statement
The IF statement can be used to form a branch structure that is judged according to the conditions given to determine which branch segment to execute.
There are three basic forms of if statements in C language
The first form of:
1. Boolean (Boolean) values and Boolean variables?? Before you speak a conditional statement, you should first look at the Boolean type. A conditional statement (if) needs to specify a Boolean or Boolean variable to determine whether the statement
The first two articles are about data types and data operations, and this article is about conditional statements and loop statements.0x00. Conditional statementsA conditional statement determines the code block that executes by executing the result
/* Conditional Control statement: if () {}else{} syntax: First structure: There is no execution if (Boolean expression) {//First Bit true, the execution of the inside of the statement, for false will not
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.