for(【初始化表达式】;【条件表达式】;【迭代表达式 】)
{
//语句块
}
for (int num = 1; num < 0; num++)
{
Response.Write(num);
}
Response.Write("结果:<br />" );
for (int num = 1; num < 5; ++num)
{
Response.Write(num + "<br />");
}
int tmp = 0;
i = 1;
i = tmp;
for (int i = 9; i-- > 0; )
{
Response.Write(i);
}
for (int i = 10; i-- > 0; )
{
Response.Write(i);
}
for (int i = 9,j = 1; i > 0&&j < 5; i--,j++)
{
Response.Write(i + "*" + j + "=" + i*j + "<br />");
}
for循环支持多表达式,上面的执行结果是:
例子五:
for(;;)
{
}
新闻热点
疑难解答
图片精选