HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Logic Programming: execute code conditionally.
C # allow code execution according to the conditions.
Use an if statement to determine the conditions. According to the judgment result, if statement returns true or false:
else if statement may contain conditions.
else conditions defined code if the condition is false to be executed.
Note: In the example above, if the first condition is true, if the code block will be executed. else if conditions are covered in addition to the condition of "all other cases."
You can use multiple criteria to judge else if conditions:
In the example above, if the first condition is true, if the code block will be executed.
If the first condition is not true and the second condition is true, else if the code block will be executed.
Number else if the condition is not limited.
If the if and else if conditions are not true, the last else block (without conditions) covers "all other cases."
switch blocks can be used to test a number of separate conditions:
Test value (day) is written in parentheses. case and any number of values in order to break the statement ending lines of code for each individual test conditions have a semicolon ends. If the test value matches the value of the case, the corresponding line of code is executed.
switch block has a default (default :), when all the specified circumstances do not match, it covers "all other cases."