*/
}
循环指令
在C语言中有两个重要的循环指令在所有的循环类型起作用——break和continue指令。...所以只有偶数被打印出来:
int n = 0;
while (n < 10) {
n++;
/* 检查n是否为奇数 */
if (n % 2 == 1) {
/* 回到...while代码块的开头 */
continue;
}
/* 只有当n是偶数时,才能执行到这行代码 */
printf("The number %d is even...在while循环中,你必须写两个if判断,
它们以如下方式改变循环的流程(不改变printf命令):
如果当前数字小于5,不打印。
如果当前数字大于10,不打印并停止循环。...Tutorial Code
#include
int main() {
int array[] = {1, 7, 4, 5, 9, 3, 5, 11, 6, 3, 4};