All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
ASP.NET,2.0移动开发入门之使用模拟器_[Asp.Net教程]
DataTable操作中的性能问题_[Asp.Net教程]
SQL数据操作基础(中级)10_mssql学习_编程技术
asp.net2.0中GridView控件应用实例
ASP.NET,MVC+LINQ开发一个图书销售站点(10)-作者管理_[Asp.Net教程]
什么是垂直搜索?_php资料_编程技术
使用ASP.NET语法创建Web服务器控件模板_[Asp.Net教程]
C#代码书写规则
讲解:自己做出VS.NET风格的右键菜单_.net资料_编程技术
C#简介-,类和对象_[Asp.Net教程]
Reading number is top 10 pictures
The money of more than 100 countries and regions22
I also want to live a June 1 children's day, dad
yy365网站上的美女2
ashlynn brooke
Absolutely shocked. National geographic 50 animal photographys7
乳娘帕梅拉安德森2
Athena chu perspective cheongsam shine with New York
Ashlynn Brooke a group sexy photo3
这玉米,买还是不卖?
含苞欲放的素颜美少女1
Download software ranking
Proficient in JavaScript
中国结婚习俗实录
卡丁车单机版
Eclipse 4.2.1 For Win32
Boxer's Top ten classic battle2
Boxer vs Yellow2
Proficient in Eclipse
The king of fighters 97(Mobile phone games-apk)
Unix video tutorial5
Boxer's Top ten classic battle5
qq published in(发表于) 2014/7/11 9:16:14 Edit(编辑)
C#中do while语句的使用实例详解

C#中do while语句的使用实例详解

C#中do while语句的使用实例详解

do-while语句

do-while循环与while循环类似,只要布尔表达式为True,循环体就会不断地重复执行,但do-while语句会先执行一次内嵌的语句,然后判断布尔表达式是True或False。它对应的循环体执行一次(至少一次)或若干次,其语法如下:

do

{

循环体

}

while(布尔表达式);


注意:while布尔表达式后的分号一定要写,否则出现语法错误。

示例

do-while语句的使用

利用do-while语句循环一次的流程如图1所示。



图1 do-while语句流程

程序代码如下:

using System;

class WhileTest

// http://www.isstudy.com

{

static void Main()

{

Console.WriteLine("输出结果为:");

int n = 1;

do

{

Console.WriteLine("循环{0} 次", n);

n++;

}

while (n < 0);

Console.Read();

}

}


键运行程序,运行结果如图2所示。



添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.