网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

9、执行以下程序后的输出结果为 #include <stdio.h> int main() { int a=1,b=0; switch (a) { case 1: switch (b) { case 0: printf("**0**");break; case 1: printf("**1**");break; } case 2: printf("**2**");break; } return 0; }

A.**0****2**

B.**0**

C.**0****1****2**

D.有语法错误


参考答案和解析
11 本题考核的知识点是printf()函数的输出格式.本题中定义了一个整型变量i并赋初值为9,然后要求以八进制输出i的值,因为9的八进制的表示为11,所以最后输出的值为11。
更多 “9、执行以下程序后的输出结果为 #include <stdio.h> int main() { int a=1,b=0; switch (a) { case 1: switch (b) { case 0: printf("**0**");break; case 1: printf("**1**");break; } case 2: printf("**2**");break; } return 0; }A.**0****2**B.**0**C.**0****1****2**D.有语法错误” 相关考题
考题 以下程序的运行结果是 【 9 】 。main( ){ int a=2,b=7,c=5;switch(a0){ case 1:switch(b0){ case 1: printf ("@"); break;case 2: printf("!"); break;}case 0: switch(c==5){ case 0 : printf (" * "); break;case 1 : printf(" # "); break;case 2: printf(" $ "); break;}default : printf("");}printf("\n");}

考题 有以下程序#include stdio.hmain(){ int x=1,y=0,a=0,b=0;switch(x){ case 1:switch(y){ case 0: a++; break;case 1: b++; break;}case 2: a++; b++; break;case 3: a++; b++;}printf("a=%d, b=%d\n",a,b);}程序的运行结果是A)a=1 , b=0B)a=2, b=2C)a=1, b=1D)a=2, b=1

考题 下列程序的输出结果是______。 main() { int i=3; switch(i) { case 1: case 2:printf("%d",i); case 3: case 4:break; default:printf("OK"); } }A.0B.3C.OKD.没有任何输出

考题 请阅读以下程序:includemain(){int x=1,y=0,a=0,b=0;switch(x){case 1:switch(y){case 请阅读以下程序: #include<stdio.h> main() { int x=1,y=0,a=0,b=0; switch(x) { case 1: switch(y) { case 0:a++;break;} case 2: a++,b++;break;} printf("a=%d,b=%d\n",a,b); 上面程序的输出结果是A.a=2,b=1B.a=1,b=1C.a=1,b=0D.a=2,b=2

考题 有以下程序#include stdio.hmain(){ int x=1,y=0,a=0,b=0;switch(x){ case 1:switch(y){ case 0:a++; break;case 1:b++; break;}case 2:a++; b++; break;case 3:a++; b++;}printf("a=%d,b=%d\n",a,b);}程序的运行结果是A.a=1,b=0B.a=2,b=2C.a=1,b=1D.a=2,b=1

考题 有以下程序:includemain(){intx=1,y=0,a=0,b=0;switch(x){case 1:switch(y){case 0:a+ 有以下程序: #include<stdio.h> main() { int x=1,y=0,a=0,b=0; switch(x) { case 1: switch(y) { case 0:a++;break; case 1: b++;break; } case 2:a++;b++;break; case 3:a++;b++; } printf("a=%d,b=%d\n",a,B); } 程序的运行结果是( )。A.a=1,b=0B.a=2,b=2C.a=1,b=1D.a=2,b=1

考题 以下程序段的运行结果是( )。 include main() {int x=2,y=1: switch(x) {case 1: switch 以下程序段的运行结果是( )。 include<stdio.h> main() {int x=2,y=1: switch(x) {case 1: switch(y) {case 0:printf("x=2,y=1\n");break; case 1:printf("y=1\n");break; } case 2:printf("x=2\n"); } }

考题 下面程序的输出结果为( )。 main( ) { int a=1,b=0; switch(a) { case 1:switch (b) { case 0: printf("**0**"); break; case 1: printf("**1**"); break; } case 2: printf("**2**"); break; }}A.**0**B.**0****2**C.**0****1****2**D.有语法错误

考题 以下程序的运行结果是( )。main()(int a=2,b=7,c=5;switch(a>0){case 1:switch(b<0){case 1:switch(");break;case 2:printf("!");break;}case 0:switch(c==5){case 0:printf("*");break;case 1:printf("");break;case 2:printf("$");break;}default:printf ("&");}printf("\n");}

考题 有下列程序:includemain(){ int a=6,b=7,m=1;switch(a%2){ case 0:m++;break;case 1:m 有下列程序:#include<stdio.h>main(){ int a=6,b=7,m=1; switch(a%2) { case 0:m++;break; case 1:m++; switch(b%2) { defaut:m++; case0:m++;break; } } printf("%d\n",m);}程序运行后的输出结果是( )。A.1B.2C.3D.4

考题 有以下程序includemain(){int k=5,n=0;while(k>0){switch(k){defhult:break;case 1:n+ 有以下程序 #include<stdio.h> main() {int k=5,n=0; while(k>0) {switch(k) {defhult:break; case 1:n+=k: case 2: case 3:n+=k; } k--; } printf("%d\n",n); } 程序运行后的输出结果是( )A.0B.4C.6D.7

考题 设有说明:int a=1,b=0;,则执行以下语句的输出结果是______。 switch(a) {case 1: switch(b) {case 0:printf("**0**\n");break; case 1:printf("**1*\n");break; } case 2:printf("**2**\n");break; }A.**0**B.**0** **2**C.**0** **1** **2**D.switch语句中存在语法错误

考题 有以下程序includemain(){intx=1,y=0,a=0,b=0;switch(X){case1:switch(y){case0:a++;b 有以下程序 #include <stdio.h> main() { int x=1,y=0,a=0,b=0; switch(X) { case 1: switch(y) { case 0:a++; break; case 1:b++; break; } case 2:a++;b++;break; case 3:a++;b++; } printf("a=%d,b=%d\n",a,b); } 程序A.a=1,b=0B.a=2,b=2C.a=1,b=1D.a=2,b=1

考题 有下列程序:includemain(){int x=1,y=0,a=0,b=0;switch(x){ case 1:switch(y){ case 0 有下列程序: #include <stdio.h> main() { int x=1,y=0,a=0,b=0; switch(x) { case 1: switch(y) { case 0:a++;break; case 1:b++;break; } case 2: a++;b++;break; case 3: a++;b++; } printf("a=%d,b=%d\n",a,B) ; } 程序的运行结果是( )。A.a=1,b=0B.a=2,b=2C.a=1,b=1D.a=2,b=1

考题 有下列程序:includemain(){int a=6,b=7,m=1; switch(a%2) {case0:m++;break;case 1=m+ 有下列程序: #include<stdio.h> main() { int a=6,b=7,m=1; switch(a%2) { case0:m++;break; case 1=m++; switch(b%2) { defaut:m++; case0:m++;break; } } printf("%d\n",m); } 程序运行后的输A.1B.2C.3D.4

考题 以下程序的输出结果是()。includemain(){int a=8,b=6,m=1;switch(a%4){case 0:m++;brea 以下程序的输出结果是( )。 #include<stdio.h> main() {int a=8,b=6,m=1; switch(a%4) {case 0:m++; break; case 1:m++; switch(b%3) {default:m++; case 0:m++;break; } } printf("%d\n",m);}A.1B.2C.3D.4

考题 有以下程序:includemain(){int a=6,b=7,m=I;switch(a%2){case 0:m++;break;case 1:m++ 有以下程序: #include<stdio.h> main() {int a=6,b=7,m=I; switch(a%2) {case 0:m++;break; case 1:m++; switch(b%2) {defaut:m++; case 0:m++;break; } } printf("%d\n",m); } 程序运行后的输出结果是( )。A.1B.2C.3D.4

考题 有以下程序: main() { int a=15,b=21,m=0; switch(a%3) {case 0:m++;break; case 1:m++; switch(b%2) { default:m++; case 0;m++;break; } } printf("%d\n",m); } 程序运行后的输出结果是( )。A.1B.2C.3D.4

考题 有以下程序: main( ) { int a=15,b=21,m=0; switch(a%3) { case 0:m++;break; case l:m++; switch(b%2) { default:m++; case 0:m++;break; } } printf("%d\n",m); } 程序运行后的输出结果是A.1B.2C.3D.4

考题 有以下程序 #includestdi0.h main( ) {int a[]={2,3,5,4),i; for(i=0;i4;i++) switch(i%2) {case 0:switch(a[i]%2) {case 0:a[i]++;break; case l:a[i]--; }break; case1:a[i]=0; } for(i=0;i4;i++)printf("%d",a[i]);printf("\n"); } 程序运行后的输出结果是( )。A.3344B.2050C.3040D.0304

考题 以下程序的输出结果是includemain(){ inta=15/b=21,m=0;switch(a%3){ case0:m++;break 以下程序的输出结果是 #include<stdio.h> main() { int a=15/b=21,m=0; switch(a%3) { case0:m++;break; case 1:m ++; switch(b%2) { default:m++; case 0:m ++;break;}} printf("%d\n",m);}A.1B.2C.3D.4

考题 有下列程序: include main() {int a=6,b=7,m=1; switch(a%2) {case 0:m++;break; cas 有下列程序:#include<stdio.h>main(){ int a=6,b=7,m=1;switch(a%2){ case 0:m++;break;case 1:m++;switch(b%2){ defaut:m++;case0:m++;break;}}printf("%d\n",m);}程序运行后的输出结果是( )。A.1B.2C.3D.4

考题 有以下程序: include main() {int a=6,b=7,m=1;switch(a%2){ case 0:m++;break;case 1 有以下程序: #include<stdio.h> main() { int a=6,b=7,m=1; switch(a%2) { case 0:m++;break; case 1 :m++; switch(b%2) { defaut:m++; case0:m++;break; } } printf("%d\n",m); }A.1B.2C.3D.4

考题 请阅读以下程序:includemain(){ int x=1,y=0,a=0,b=0;switch(x){ case 1:switch(y){ c 请阅读以下程序: #include<stdio.h> main() { int x=1,y=0,a=0,b=0; switch(x) { case 1: switch(y) { case 0:a++;break; case 2: a++,b++;break;} printf("a=%d,b=%d\n" ,a,b); 上面程序的输出结果是( )。A.a=2,b=1B.a=1,b=1C.a=1,b=0D.a=2,b=2

考题 下列程序的输出结果是(). main( ) { int x=1,y=0,a=0,b=0; switch(x) { case 1:switch(y) { case 0:a++;break; case 1:b++;break; } case 2:a++;b++;break; case 3:a++;b++;break; } printf("a=%d,b=%d/n",a,b); }A、a=1,b=0B、a=2,b=1C、a=1,b=1D、a=2,b=2

考题 单选题有以下程序#include main(){ int x=1,y=0,a=0,b=0; switch(x) {  case 1:      switch(y)      {       case 0:a++;break;       case 1:b++;break;      }  case 2:a++;b++;break;  case 3:a++;b++; } printf(a=%d,b=%d,a,b);}程序的运行结果是(  )。A a=2,b=1B a=2,b=2C a=1,b=1D a=1,b=0

考题 单选题有以下程序#include main(){ int x=1,y=0,a=0,b=0; switch(x) {  case 1:      switch(y)      {       case 0:a++;break;       case 1:b++;break;      }  case 2:a++;b++;break;  case 3:a++;b++;break; } printf(a=%d,b=%d,a,b);}程序的运行结果是(  )。A a=1,b=0B a=2,b=2C a=1,b=1D a=2,b=1

考题 单选题有以下程序:#include main(){ int a[]={2,3,5,4},i; for(i=0;i4;i++) switch(i%2) {  case 0:      switch(a[i]%2)      {       case 0:a[i]++;break;       case 1:a[i]--;      }break;  case 1:a[i]=0; } for(i=0;i4;i++)printf(%d,a[i]); printf();}程序运行后的输出结果是(  )。A 3344B 2050C 3040D 0304