Loop structure in C#

1. switch case multi-branch structure
Insert picture description here
Insert picture description here
2. try catch to solve the exception

3. For loop It is
generally more convenient to use for loop to know the number of loops
Insert picture description here

The nine-nine multiplication table using the for loop:
square
Insert picture description here
triangle
Insert picture description here
4. The while loop judges first, and then executes the loop. Example: 80,000 trainees were trained in 2006, an annual increase of 25%. According to this growth rate, in which year the number of trainees will be When reaching 200,000 people,
Insert picture description here
Insert picture description here
break is used in the loop to exit the current loop.
Insert picture description here
5. The do while loop executes the loop body once and then judges whether the condition is established
Insert picture description here

Guess you like

Origin blog.csdn.net/qq_44685392/article/details/113483632