10-14c# Base-statement (Switch....case and for ... Cycle

Source: Internet
Author: User

10-14c# Basis-statement (2)

First, pre-class homework: "With the computer Scissors"

switch (defined variable, parameter value) ... case .....

Note: Switch...case are mostly used for value type judgments, which are different from if expressions (relational operations).

Exercise 1:

Exercise 2:

Third, for ("because") .... Cycle

Knowledge point 1:

Knowledge point 2: add Break (jump), jump out of the loop body.

Exercise 1:

Exercise 2:

Exercise 3:

Or the following method:

Note:

Exercise 5:

The above is switch...case. Statements and for ... The knowledge point of the statement, and the for ... Statements are the most functional loop statements and can be nested for ... Statement, you can also nest if...else ... Statements, so are commonly used statements, proficiency.

10-14c# Base-statement (Switch....case and for ... Cycle

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.