网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
下面哪一个循环会导致死循环?()
- A、for(intk=0;k<0;k++)
- B、for(intk=10;k>0;k--)
- C、for(intk=0;k<10;k--)
- D、for(intk=0;k>0;k++)
参考答案
更多 “下面哪一个循环会导致死循环?()A、for(intk=0;k0;k++)B、for(intk=10;k0;k--)C、for(intk=0;k10;k--)D、for(intk=0;k0;k++)” 相关考题
考题
有以下程序main( ){ int k=5,n=0;do{ switch(k){ case 1: case3: n+=1; k--; break;default;n=0;k--;case 2: case4: n+=2;k--; break;}printf("%d",n);}while(k0 n5);}程序运行后的输出结果是A)235B)0235C)02356D)2356
考题
下面程序的运行结果是()#includestdio.hmain(){intk=0;charc='A';do{switch(c++){case'A':k++;break;case'B':k--;case'C':k+=2;break;case'D':k=k%2;continue;case'E':k=k*10;break;default:k=k/3;}k++;}while(c'。:A.k=3B.k=4C.k=2D.k=0
考题
下列语句段中不是死循环的是()。A、intI=100;while(1){I=I0+1;if(I=20)break;}B、intI;sum=0;for(I=1;;I++)sum=sum+1;C、intk=0;do{++k;}while(k>=0);D、ints=3379;while(s++%2+3%2)s++;
考题
有下列程序: main { int k=5,n=0; while(k0) {switch(k) {dcfault:break; case 1:n=n+k; case 2: case 3:n+=k; } k--; } printf("%d\n".n); } 程序运行后的输出结果足( )。A.0B.4C.6D.7
考题
以下选项中循环结构合法的是()。A.while(inti<7)(i++;system.out.println("iis"+i);}B.intj=3;while(j){system.out.println("jis"+j);}C.intj=0;for(intk=0;j+k!=10;j++,k++){system.out.println("jis"+j+"kis"+k);}D.intj=0;do{system.out.println("jis"+j++);if(j==3){continueloop;}}while(j10);
考题
有以下程序main(){int k=5,n=0;do{switch(k){case 1: case 3:n+=1;k--;break;default:n=0;k--;case 2: case 4:n+=2;k--;break;}printf("%d",n);}while(k0 n5);}程序运行后的输出结果是A.235B.0235C.02356D.2356
考题
对于以下程序, main( ) { int a[5],*p; int k; for(k=0,p=a;k5;k++,p++) scanf(“%d”,p); for(;k0;k--) printf(“%d”,*(--p)); } 若输入为:1 2 3 4 5(注:表示回车),则输出结果是多少?
考题
下面哪一个循环会导致死循环()A、for (int k = 0; k 0; k++)B、for (int k = 10; k 0; k--)C、for (int k = 0; k 10; k--)D、for (int k = 0; k 0; k++)
考题
若有类W说明class W{int a;public:voidfConst(int)const;};,则函数fConst的正确定义是()A、void W::fConst(intk)const{k=a;}B、void W::fConst(intk)const{k=a++;}C、void W::fConst(intk)const{cina;}D、void W::fConst(intk)const{a=k;}
考题
若墙后填土为正常固结粘性土,其固结不排水抗剪强度指标ccu、φcu与有效应力抗剪强度指标c’、φ’为已知,填土的重度为γ,则静止土压力系数K0可表示为()。A、K0=1-sinφcuB、K0=2ccu/γC、K0=1-sinφ’D、K0=2c’/γ
考题
问答题对于以下程序, main( ) { int a[5],*p; int k; for(k=0,p=a;k0;k--) printf(“%d”,*(--p)); } 若输入为:1 2 3 4 5(注:表示回车),则输出结果是多少?
考题
单选题有如下程序,其中k的初始值为八进制数:#includemain( ){intk=011;printf(“%d”,k++);}程序运行后的输出结果为( )。A
12B
11C
10D
9
考题
单选题下面哪一个循环会导致死循环()A
for (int k = 0; k 0; k++)B
for (int k = 10; k 0; k--)C
for (int k = 0; k 10; k--)D
for (int k = 0; k 0; k++)
考题
单选题下面哪一个循环会导致死循环?()A
for(intk=0;k0;k++)B
for(intk=10;k0;k--)C
for(intk=0;k10;k--)D
for(intk=0;k0;k++)
考题
单选题若有类W说明class W{int a;public:voidfConst(int)const;};,则函数fConst的正确定义是()A
void W::fConst(intk)const{k=a;}B
void W::fConst(intk)const{k=a++;}C
void W::fConst(intk)const{cina;}D
void W::fConst(intk)const{a=k;}
热门标签
最新试卷