下面程序段中,循环语句的循环次数是______。 int x=0; while(x<6 ) { if (x%2 ) continue; if (x==4 ) break; x++; }
A.1
B.4
C.6
D.死循环
第1题:
以下程序的输出结果是______。main(){ int i,j,x=0; for (i=0;i<2;i++) { x++; for(j=0;j<3;j++) { if(j%2) continue; x++; } x++; } printf("x=%d\n",x);}
A.x=4
B.x=8
C.x=6
D.x=12
第2题:
有以下程序: #include <iostream> using namespace std; int main () { int x=15; while (x>10&&x<50) { x++; if (x/3) { x++; break; } } cout<<x<<endl; return 0; } 执行后的输出结果是
A.15
B.16
C.17
D.18
第3题:
下面程序的输出是______。 main() {int x=3,y=6,a=0; while(x++!=y-=1)) { a+=1; if(y<x)break; } printf("x=%d,a=%d\n",x,y,A) ; }
A.x=4,y=4,a=1
B.x=5,y=5,a=1
C.x=5,y=4,a=3
D.x=5,y=,a=1
第4题:
有以下程序:main(){int i, j, x=0; for(i=0; i<2; i++) { x++; for( j=0; j<=3; j++) { if(j%2) continue; x++; } x++; } printf("x=%d\n", x);}程序执行后输出结果是( )。
A.x=4
B.x=8
C.x=6
D.x=12
第5题:
下面for语句的循环次数为( )。 for(x=l,y=0;(y!=19)&;&.(x<;6);x++);
A.是无限循环
B.循环次数不定
C.最多执行6次
D.最多执行5次
第6题:
有以下程序: #include <iostream> using namespace std; int main() { int x=15; while(x>10&&x<50) { x++; if(x/3) { x++; break; } } cout<<x<<end1; return 0; }
A.15
B.16
C.17
D.18
第7题:
有以下程序: #include<iostream> using namespace std; int main() { int x=15; while(x>10&&x<50) { x++; if(x/3) { x++;break; } } cout<<x<<endl; return 0; } 执行后的输出结果是( )。
A.15
B.16
C.17
D.18
第8题:
下列程序段中循环体的执行次数是______。 int x=-12; while (x=0) x=x+1;
A.While循环执行12次
B.循环体语句执行一次
C.循环是死循环
D.循环体语句一次也不执行
第9题:
以下程序的输出结果是( )。 #include<iostream.h> void main() {int i,j,x=0; fof(i=0;i<2;i++= {x++; for(j=0:j<3;j++= {if(j%2)continue; x++; x++;} cout<<"x="<<X;=
A.x=4
B.x=8
C.x=6
D.x=12
第10题:
有以下程序 main( ) {int i,j,x=O; for(i=0;i<2;i++) {x++; for(j=0;j<=3;j++) {if(j%2)continue; x++; } x++; } printf(”x=%d/n”,x); } 程序执行后的输出结果是()
第11题:
下面程序段中循环语句的循环次数是()。 For x=10 To 1 Step -3 Write(x) Next x
第12题:
x=4
x=6
x=8
x=12
第13题:
以下程序的输出结果是 #include<iostream.h> void main( ) {int i,j,x=0; for(i=0;i<2;i++) { x++; for(j=0;j<3;j++) { if(j%2)continue; x++;} x++;} cout<< "x="<<x;}
A.x=4
B.x=8
C.x=6
D.x=12
第14题:
下面程序的输出是________。 main() {int x=3,y=6,a=0; while(x++!=(y=|)) { a+=1; if(y<x)break; } printf("x=%d,y=%d,a=%d\n",x,y,A) ; }
A.x=4,y=4,a=1
B.x=5,y=5,a=1
C.x=5,y=4,a=3
D.x=5,y=4,a=1
第15题:
for(int x=0,y=0;!x&&y<=5;y++)语句执行循环的次数是( )。
A.0
B.5
C.6
D.无穷
第16题:
以下程序运行后的输出结果是main(){ int x=15; while(x>10&&x<50) { x++; if(x/3) { x++; break; } else continue; } printf("%d\n",x);}
第17题:
下面for语句的循环次数为( )。 for(x=1,y=0;(y!=19)&&(x<6);x++);
A.是无限循环
B.循环次数小定
C.最多执行6次
D.最多执行5次
第18题:
有以下程序:#inelude <stdio.h>main( ){ int i,j,x=0; for(i=0;i<2;i++ ) { x++; for(j=0;j<=3;j ++) { fi(j%2) continue; x++; x++; } pfinff( "x = % d\n",x);} 程序执行后的输出结果是( )。
A.x=4
B.x=8
C.x=6
D.x=12
第19题:
有以下程序: #inclyde<iOStream> using namespace std; int main() { int x=15; while(x>10&&x<50) { x++; if(x/3) { x++;break; } } cout<<x<<endl; return 0; } 执行后的输出结果是
A.15
B.16
C.17
D.18
第20题:
有以下程序: #include <iostream> using namespace std; int main() { int x=15; while(x>10&&x<50) { x++; if(x/3) { x++; break; } } cout<<x<<end1; return 0; } 执行后的输出结果是
A.15
B.16
C.17
D.18
第21题:
以下程序运行后的输出结果是【 】。
main( )
{ int x=15;
while(x>10 &&x<50)
{ x++;
if(x/3){ x++;break;}
else continue;
}
printf("%d\n",x);
}
第22题:
阅读下列代码段int x=3;while (x<9) x+=2;x++;while语句成功执行的次数是()。
第23题:
1
2
3
4
第24题:
x=8
x=4
x=6
x=12