| 查看: 671 | 回复: 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. |
» 猜你喜欢
博士申请都是内定的吗?
已经有13人回复
谈谈两天一夜的“延安行”
已经有8人回复
氨基封端PDMS和HDI反应快速固化
已经有11人回复
之前让一硕士生水了7个发明专利,现在这7个获批发明专利的维护费可从哪儿支出哈?
已经有11人回复
论文投稿求助
已经有4人回复
Applied Surface Science 这个期刊。有哪位虫友投过的能把word模板发给我参考一下嘛
已经有3人回复
投稿精细化工
已经有6人回复
» 本主题相关价值贴推荐,对您同样有帮助:
UDS及其后处理求助!
已经有12人回复
请教一个while loop程序的问题
已经有5人回复
3楼2011-06-07 09:46:04
mengxc
木虫 (著名写手)
- 应助: 3 (幼儿园)
- 金币: 4128.1
- 散金: 6
- 红花: 12
- 沙发: 2
- 帖子: 1342
- 在线: 491.6小时
- 虫号: 1148508
- 注册: 2010-11-16
- 专业: 数论
2楼2011-06-07 08:38:30
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













;
回复此楼

