| 查看: 681 | 回复: 5 | ||
[求助]
请教一个while loop的问题
|
|
下面两个while loop的小程序,第二个比第一个多了一行,在跳出while loop后为什么会output n=4的值? main ( ) { int n = 0; while (n++<3) printf("n is %d\n", n); printf("That's all this program does.\n" ;} OUTPUT: n is 1 n is 2 n is 3 That's all this program does. ---------------------------------------------------------------------------------------- main ( ) { int n = 0; while (n++<3) printf("n is %d\n", n); printf("n is %d\n", n); printf("That's all this program does.\n" ;} OUTPUT: n is 1 n is 2 n is 3 n is 4 That's all this program does. |
» 猜你喜欢
毕业后当辅导员了,天天各种学生超烦
已经有5人回复
职称评审没过,求安慰
已经有50人回复
26申博自荐
已经有3人回复
A期刊撤稿
已经有4人回复
垃圾破二本职称评审标准
已经有17人回复
投稿Elsevier的Neoplasia杂志,到最后选publishing options时页面空白,不能完成投稿
已经有22人回复
EST投稿状态问题
已经有7人回复
» 本主题相关价值贴推荐,对您同样有帮助:
UDS及其后处理求助!
已经有12人回复
请教一个while loop程序的问题
已经有5人回复
mengxc
木虫 (著名写手)
- 应助: 3 (幼儿园)
- 金币: 4128.1
- 散金: 6
- 红花: 12
- 沙发: 2
- 帖子: 1342
- 在线: 491.6小时
- 虫号: 1148508
- 注册: 2010-11-16
- 专业: 数论
2楼2011-06-07 08:38:30
3楼2011-06-07 09:46:04
mengxc
木虫 (著名写手)
- 应助: 3 (幼儿园)
- 金币: 4128.1
- 散金: 6
- 红花: 12
- 沙发: 2
- 帖子: 1342
- 在线: 491.6小时
- 虫号: 1148508
- 注册: 2010-11-16
- 专业: 数论
4楼2011-06-07 09:55:12
5楼2011-06-07 11:16:55
★ ★
xzhdty(金币+2): 有你回更精彩 2011-06-07 16:51:47
xzhdty(金币+2): 有你回更精彩 2011-06-07 16:51:47
|
6楼2011-06-07 11:46:40













;
回复此楼