sa2301.c
来自「学习C语言必备的好书」· C语言 代码 · 共 37 行
C
37 行
#include <stdio.h>
void main()
{
int i;
int count;
int index;
//while循环例子
printf("while 循环\n");
count = 0;
while (count < 6)
{
printf("The value of count is %d\n",count);
count = count + 1;
}
getch();
//do while循环例子
printf("do while 循环\n");
i = 0;
do {
printf("The value of i is now %d\n",i);
i = i + 1;
} while (i < 5);
getch();
//for循环例子
printf("for 循环\n");
for(index = 0;index < 6;index = index + 1)
printf("The value of the index is %d\n",index);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?