当前位置:网站首页>C # process control statement
C # process control statement
2022-06-09 02:34:00 【Songyulong's blog】
C# Flow control statement
C# if else
if ( Boolean expression )
{
Sentence block ;
}
if ( Boolean expression )
{
Sentence block 1;
} else {
Sentence block 2;
}
if ( Boolean expression 1)
{
Sentence block 1;
} else if ( Boolean expression 2) {
Sentence block 2;
…
} else {
Sentence block n;
}
C# switch case
switch( expression )
{
case value 1:
Sentence block 1;
break;
case value 2:
Sentence block 2;
break;
…
default:
Sentence block n;
break;
}
C# for loop
for( expression 1; expression 2; expression 3)
{
expression 4;
}
- expression 1: Give an initial value to a loop variable .
- expression 2: Set cycle conditions for the cycle , Usually Boolean expressions .
- expression 3: Used to change the size of the loop variable .
- expression 4: The expression is executed when the loop condition is met 4.
C# foreach loop
foreach( data type Variable name in Traversing objects )
{
Sentence block
}
C# while loop
while( Boolean expression )
{
Sentence block ;
}
C# do while loop
do
{
Sentence block ;
}while( Boolean expression );
C# break
Used to jump out of the current loop , Such as for loop 、while loop 、switch-case etc. .
C# continue
about for loop ,continue Statements cause conditional tests and loop increment parts to be executed . about while and do while loop ,continue Statement will cause program control to return to conditional testing .
C# goto
goto Labell;
Sentence block 1;
Labell
Sentence block 2;
边栏推荐
- "The original, skillful and vulgar skills of cloud native" -- composition of Volume I of the national new college entrance examination in 2022
- Jerry's SPI host [chapter]
- vins feature_ track
- S series · several postures for deleting folders
- Acwing 792 high precision subtraction
- 杰理之如何修改 ad_key 连接的引脚?【篇】
- How to modify ad_ Key connected pin? [chapter]
- 杰理之SPI 从机【篇】
- disable_ function_ Bypass 2019 geek challenge rce_ me
- Backup and restore methods of MySQL database
猜你喜欢
![(10.3) [steganography mitigation] steganography protection, steganography interference and steganography detection](/img/f3/a2c3445d1a972eeda9b21575ee7f58.png)
(10.3) [steganography mitigation] steganography protection, steganography interference and steganography detection

"The original, skillful and vulgar skills of cloud native" -- composition of Volume I of the national new college entrance examination in 2022

Embracing out of hospital prescription drugs, Internet medicine should also "get rid of virtual reality"?

Redis集群搭建
![[MySQL from Xiaobai to expert] Part 6: transaction and JDBC programming in MySQL](/img/e1/0807247eaf70d0fc95c3399352f1c8.png)
[MySQL from Xiaobai to expert] Part 6: transaction and JDBC programming in MySQL

进程与线程
![[coding streaming] installation and use of SRS streaming media server](/img/8a/e3462db8425377d32ec2ef22c1ccf3.png)
[coding streaming] installation and use of SRS streaming media server

Exploration and best practice of automatic verification of object acquisition technology

S系列·删除文件夹的几种姿势

技术负责人如何搞垮一个团队?
随机推荐
蓝桥杯_丢番图方程
S系列·向文本文件新增数据并且不添加重复值
杰理之关于 SPI 主机配置参数的几个说明篇】
toggleRowSelection()失效的2个重要影响因素
What is the hardware calculation principle of Jerry's ad value? [chapter]
Export related knowledge
杰理之若用户不需要使用所有的按键,其他按键应该如何设置?【篇】
Summary of 14 anomaly detection methods
Using redis in business code to achieve caching effect
CVE-2020-3187
Gunicorn 20.0.4 request smuggling vulnerability
Exploration and best practice of automatic verification of object acquisition technology
Phar deserialization learning swpuctf2018 simplephp
SQLite3 syntax (2)
CVE-2022-30525漏洞複現
Go Technology Daily (2022 - 06 - 07) - go programer Development Efficiency God Summary
Acwing 791 high precision addition
杰理之SPI主机【篇】
Database table cannot add content display modification cannot save prompt 1452 error
Geotrust证书价格