更多“有下列程序: #include<stdio.h> main { int x=0; int y=0; while(x<7 &&++v) { y--; x+”相关的问题
第1题
以下程序的输出结果是 。 #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
点击查看答案
第2题
#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; } 该程序的运行结果是________
点击查看答案
第3题
有以下程序 #include<stdio.h> main() {int x,y; scanf(”%2d%*3d%d”,&x,&y); printf(”%d\n”,x+y); } 程序运行时输入:1234567程序的运行结果是
点击查看答案
第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题
以下程序的输出结果: #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); }
点击查看答案
第6题
以下程序的输出结果: #include <stdio.h> struct { int x; int y; }s[2]={1,4,2,5}; void main() { printf("%d\n",s[0].y/s[0].x*s[1].x); }
点击查看答案
第7题
以下程序的执行结果是() #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; }
点击查看答案
第8题
下述代码,输出结果为 # 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; }
点击查看答案
第9题
#include <stdio.h> extern serial_initial(); main() { int x,y,z; serial_initial(); printf("input data x, y ?\n"); scanf("%d %d",&x,&y); printf("\n x y !x x||y x&&y"); printf("\n%3d%3d",x,y); z=!y; printf("%5d",z); z=x||y; printf("%5d",z); z=x&&y; printf("%5d",z); printf("\n");printf("\n"); printf("That is all\n"); while(1); } _____________________________________________________________________________________________________________________
点击查看答案
第10题
有以下程序: #include<stdio.h> main() { int w =4, x =3, y =2, z =1; printf ("%d\n", (w < x? w: z < y? y:x); } 程序的输出结果是
点击查看答案