更多“请写出下面程序的输出结果。 #include <stdio.h> int main () { int x = 0, y = 1, z; z=2*x+y; #ifdef TEST printf ("%d…”相关的问题
第1题
#include <stdio.h> int main( ) { int x=1, y=1, z=1; switch(x) { case 1: switch(y) { case 1: printf("!!"); break; case 2: printf("@@"); break; case 3: printf("##"); break; } case 0: switch(z) { case 0: printf("$$"); case 1: printf("^^"); case 2: printf("&&"); } default: printf("**"); } return 0; } 该程序的运行结果是________
点击查看答案
第2题
下列程序的执行结果是( ). #include <stdio.h> int main( ) { int x=0,y=2,z=1; if (x=z=y) x=3; printf("%d,%d\n",x,z); return 0; }
点击查看答案
第3题
以下程序的输出结果是 。 #include <stdio.h> main() { int x=0,a=0,b=0; switch(x){ case 0: b++; case 1: a++; case 2: a++;b++;} printf(“a=%d,b=%d\n”,a,b); }
A、a=2,b=1
B、a=1,b=1
C、a=1,b=0
D、a=2,b=2
点击查看答案
第4题
#include <stdio.h> int fun(int x, int y) { if(x>y) return x; else return y; } void main() { int x=3,y=8,z=6,r; r=fun(fun(x,y),2*z); printf("%d\n",r); } 下面程序输出结果是:
点击查看答案
第5题
执行下面程序后,i的值为( )。 #include<stdio.h> main() { int i,x; for(i=1,x=1;i<=20;i++) { if(x%2="=1)" {x+="5;continue;}" if(x>=10)break; x-=3; } }
点击查看答案
第6题
下面程序的输出结果是() #include <stdio.h> void main() { int x = 7; int y = 3; printf("%d\n", y = x / y); }
点击查看答案
第7题
有以下程序 #include<stdio.h> main() {int x,y; scanf(”%2d%*3d%d”,&x,&y); printf(”%d\n”,x+y); } 程序运行时输入:1234567程序的运行结果是
点击查看答案
第8题
以下程序的执行结果是() #include <stdio.h> int multi(int x,int y); void main() { int a,b,c; a=10,b=12; c=mult(a,b); printf("%d*%d=%d",a,b,c); } int multi(int x,int y) { return x*y; }
点击查看答案
第9题
以下程序的输出结果: #include <stdio.h> union { struct { int x; int y; }s1; int a; int b; }u1; void main() { u1.a=3; u1.b=4; u1.s1.x=u1.a*u1.b; u1.s1.y=u1.a+u1.b; printf("%d,%d\n",u1.s1.x,u1.s1.y); }
点击查看答案
第10题
下述代码,输出结果为 # include <stdio.h> int f3(int &x,int &y) { x=2*y; return 3*x; } int main() { int a=5,b=6; printf("a=%d,b=%d\n",a,b); f3(a,b); printf("%d\n",a); return 0; }
点击查看答案