- 填空阅读下列程序,写出程序的输出结果。 main() {int x=100,a=10,b=20,ok1=5,ok2=0; if(a<b) if(b!=15) if(!ok1) x=1; else if(ok2) x=10; else x=-1; printf("%d\n",x); }做这题 →
- 填空24 以下程序的输出结果是______。 main() {int x=2,y=-1,z=2; if(x<y) if(y<0) z=0; else z+=1; printf("%d\n",z); } A)3 B)2 C)1 D)0做这题 →
- 填空73 以下程序的运行结果是______。 main() {int a,b,c; int s,w,t; s=w=t=0; a=-1;b=3;c=3; if(c>0) s=a+b; if(a<=0) {if(b>0) if(c<=0) w=a-b; } else if(c>0) w=a-b; else t=c; printf("%d %d %d",s,w,t); }做这题 →
- 填空74以下程序的运行结果是______。 main() {int a,b,c,d; a=c=0; b=1; d=20; if(a) d=d-10; else if(!b) if(!c) d=15; else d=25; printf("%d\n",d); }做这题 →
- 填空75 以下程序的运行结果是______。 #include <stdio.h> main() {int x,y=1,z; if(y!=0) x=5; printf("\t%d\n",x); if(y==0) x=4; else x=5; printf("\t%d\n",x); x=1; if(y<0) if(y>0) x=4; else x=5; printf("\t%d\n",x); }做这题 →
- 填空111 以下程序段的运行结果是______。 int x=1,y=0; switch(x) {case 1: switch(y) {case 0:printf("**1**\n");break; case 1:printf("**2**\n");break; } case 2:printf("**3**\n"); }做这题 →
- 填空39 下面程序的运行结果是______。 #include<stdio.h> main() {int x,i; for(i=1;i<=100;i++) {x=i; if(++x%2==0) if(++x%3==0) if(++x%7==0) printf("%3d",x); } } A) 39 81 B)42 84 C)26 68 D)28 70做这题 →
- 填空利用条件运算符的嵌套来完成此题:学习成绩>=90 分的同学用 A 表示, 60-89 分之间的用 B 表示,60 分以下的用 C 表示。做这题 →
- 单选在嵌套使用 if 语句时,C 语言规定 else 总是()做这题 →
- 单选为了避免在嵌套的条件语句if...else中产生二义性,C语名规定,else子句总与()配对做这题 →
- 单选设有一分段函数,则下列程序段哪个是正确的____。 { \begin{array}{l l} {x=1} & { a=b} \end{array} .做这题 →
- 填空74以下程序的运行结果是______。 main() {int a,b,c,d; a=c=0; b=1; d=20; if(a) d=d-10; else if(!b) if(!c) d=15; else d=25; printf("%d\n",d); }做这题 →
- 单选为了避免在嵌套的条件语句if-else的二义性,C语言规定:else总是与之配对的if是()做这题 →
- 综合有以下程序 c #include main(){ int a=2, b=1; if(!a) b++; else if(a==0) if(a) b+=2; else b+=3; printf("%d\n", b); } 程序运行后的输出结果是____。做这题 →
- 综合(判断)if-else 语句允许嵌套吗?做这题 →
- 判断C 语言中条件选择结构 if 中可以嵌套重复结构 while。做这题 →
- 填空有以下程序: c #include main(){ int a=0, b=1,c=-1; if(a) b++; else if(a==0) if(b==0)c++; else c++; printf("%d\n", ~c); system("pause"); printf("\n"); } 则程序运行后输出的结果()做这题 →
- 单选读下面程序段,当 x=-3 时,输出 y 的值为 matlab int x,y; y=0; scanf("%d",&x); if(x>=0) if(x>0) y=1; else y=-1; printf("y=%d",y);做这题 →
- 单选C语言的if语句嵌套时,if与else的配对关系是()。做这题 →
- 综合#include main ( ) { float c=3.0 , d=4.0; if ( c>d ) c=5.0; else if ( c==d ) c=6.0; else c=7.0; printf ( “%.1f\n”,c ) ; } 运行结果为:7.0 此题为if...else...语句的嵌套,第二if...else...作为第一个if...else...语句else部分的复合语句。 若表达式c>d成立,则执行c=5.0; 否则(表达式c>d不成立) 若表达式c==d成立,则执行c=6.0; 否则,执行c=7.0; 输出c中的值做这题 →
- 单选执行下列语句后输出的结果是( ) int a=8,b=7,c=6; if(a<b)if(b>c){a=c;c=b;} printf("%d,%d,%d\n",a,b,c);做这题 →
- 单选若 a=3, 执行下列语句后, b 的值为 ( )( if (a>=2) if( a!= 2) b=3; else b=2; else b=1;做这题 →
- 单选执行下列语句后输出的结果是( ) int a = 8,b = 7,c = 6, if(a<b)if(b>c){a=c;c=b;} printf("%d,%d,%d\n",a,b,c);做这题 →
- 单选C 语言对嵌套 if 语句的规定是:else 总是与( )配对。做这题 →
- 单选为了避免在嵌套的条件语句 If — else 中产生二义性,C 语言规定 else 子句总是()配对。做这题 →
- 单选执行下列程序段后,x的值是( )。 int a=8,b=7,c=6,x=1; if(a>6)if(b>7)if(c>8) x=2;else x=3;做这题 →
- 单选为了避免嵌套的条件语句 if-else 的二义性, C 语言规定: 与 else 配对的是 ( )。做这题 →
- 单选main() { int x=2, y=-1, z=2; if(x<y) if(y<0) z=0; else z+=1; printf( "%d\n" , z) ;}做这题 →
- 单选有如下嵌套的 if 语句 if(a<b) \begin{array}{l} \text {if (a < c) k = a ;} \ \text {else k = c ;} \end{array} else \begin{array}{l} \text {if(b < c) k = b;} \ \text {else k = c;} \end{array} 以下选项中与上述 if 语句等价的语句是做这题 →
- 综合有以下程序 #include <stdio.h> main(){ int a=2, b=1; if(!a) b++; else if(a==0) if(a) b+=2; else b+=3; printf("%d\n", b); } 程序运行后的输出结果是____。做这题 →
- 判断if 语句嵌套也可以没有 else。做这题 →
- 判断在 C 语言中,嵌套 if-else 语句是合法的,这意味着您可以在一个 if 或 else if 语句内使用另一个 if 或 else if 语句。做这题 →
- 填空下面程序 main() { int x=100, a=10, b=2 if(a<b) if(b!=15) if(!ok1) x=1; else if(ok2) x=10; x=-1; printf("%d\n",x); } 输出结果是____。做这题 →
- 综合假定 w、x、y、z、m 均为 int 型变量,有如下程序段: $w = 1;x = 2;y = 3;z = 4;$ #include <stdio.h> main(){ int x=1,y=2,z=3; if(x>y) if(y<z) printf("%d",++z); else printf("%d",++y); printf("%d\n",x++); } 程序的运行结果是____。做这题 →
- 单选有以下程序 #include <stdio.h> main(){ int x=1, y=0; if(!x)y++; else if(x==0) if(x)y+=2; else y+=3; printf("%d\n", y); } 程序运行后的输出结果是()做这题 →
- 单选在嵌套使用if语句时,C语言规定else总是____。做这题 →
- 单选有如下程序 main() { int a=2,b=-1,c=2; if(a<b) if(b<0) c=0; else c++; printf("%d\n",c); } 该程序的输出结果是____。做这题 →
- 单选以下程序的输出结果是( )。 main() { int k1=1,k2=2,k3=3,x=15; if(!k1) x--; else if(k2) if(k3) x=4;else x=3; printf(“x=%d\n”,x); }做这题 →
- 单选读下面程序段,当 x=-3 时,输出 y 的值为 int x,y; y=0; scanf("%d",&x); if(x>=0) if(x>0) y=1; else y=-1; printf("y=%d",y);做这题 →
- 单选当 a = 1, b = 3, c = 5, d = 4 时,执行下面一段程序后,x 的值为 ____ if (a<b) if(c<d) x=1; else if(a<c) if(b<d) x=2; else x=3; else x=6; else x=7;做这题 →
- 单选以下程序的输出结果是____ main() { int w=4,x=3,y=2,z=1; printf("%d\n",(w<x?w:z<y?z:x)); }做这题 →
- 单选有如下嵌套的if语句 if(a<b) if(a<c) k=a; else k=c; else if(b<c) k=b; else k=c; 以下选项中与上述if语句等价的语句是做这题 →
- 判断在嵌套使用 if 语句时,C 语言规定 else 和之前与其最近的且不带 else的 if 配对。正确错误做这题 →
- 填空有以下程序 #include <stdio.h> main() { int a=1,b=2,c=3,d=0; if (a==1 && b++==2) if(b!=2||c--!=3) printf("%d,%d,%d\n",a,b,c); else printf("%d,%d,%d\n",a,b,c); else printf("%d,%d,%d\n",a,b,c); } 程序运行后的输出结果是做这题 →
- 单选为了避免在嵌套的 if-else 语句中产生二义性,C语言规定与 else子句配对是做这题 →
- 判断嵌套 if 语句中的 else 和 if 任意匹配。正确错误做这题 →
- 判断C语言对if语句的嵌套层次数没有限制。正确错误做这题 →
- 填空下面程序 main() { int x=100, a=10, b=20, ok1=5, ok2=0; if(a<b) if(b!=15) if(!ok1) x=1; else if(ok2) x=10; x=-1; printf("%d\n",x); } 输出结果是做这题 →
- 填空有以下程序 #include <stdio.h> main(){ int x=1,y=2,z=3; if(x>y) if(y<z) printf("%d",++z); else printf("%d",++y); printf("%d\n",x++); } 程序的运行结果是做这题 →
- 综合若有如下程序流程图设计,请使用 C 语言代码实现该功能,并写出该流程图中实现什么功能。含图做这题 →
1 / 2下一页