循环语句“for(i=1;i<10;i++){程序块}”,其中的程序块将运行______遍。
A.1
B.2
C.9
D.10
A.1
B.2
C.9
D.10
以下不是无限循环的语句为( )。
(A)for(y=0,x=1;x>++y;x=i++) i=x;
(B)for(;;x++=i);
(C)while(1){x++;}
(D)for(i=10;;i--) sum+=i;
A.可完全向量化
B.不可向量化
C.不确定
D.可部分向量化
A.n=0; do{++n;}while(n<=0)
B.n=0; while(1){n++;}
C.n=10; while(n); {n--;}
D.or(n=0,i=1; ;i++) n+=i
函数: void f() { int i,s=0; for(i=1;i<10;i+=2) S+=i+1; printf(“%d\n”,S); } 该函数的功能是()。
A.自然数1~9的累加和
B.自然数1~10的累加和
C.自然数1~9中的奇数之和
D.自然数1~10中的偶数之和
有以下程序: #include <stdio.h> main() { int i,s=0; for(i=1;i<10;i+ =2) s+ =i+1; printf("%d\n",s); } 程序执行后的输出结果是()。
A.正整数1~9的累加和
B.正整数1~10的累加和
C.正整数1~9中奇数之和
D.正整数1~10中偶数之和
下列程序中,要求按照从小到大的顺序输出1~100之间所有能被7整除的数字,请将下列程序补充完整。
注意:请勿改动main()主方法和其他已有语句内容,仅在横线处填入适当语句。
public class Example1_3
{
public static void main(String[] argv)
{
int i = 1;
______
{
if(______)
System.out.print(i+ ",");
______
}while(i < 100);
System.out.println();
}
}