单选题有以下程序#include main(){ int a=1,b=2,c=3,x; x=(a^b)c; printf(%d,x);}程序的运行结果是(  )。A2B1C3D0

单选题
有以下程序#include main(){ int a=1,b=2,c=3,x; x=(a^b)&c; printf(%d,x);}程序的运行结果是(  )。
A

2

B

1

C

3

D

0


参考解析

解析:
a^b = 00000001b ^ 00000010b = 00000011b = 3,3&c = 00000011b & 00000011b = 3。答案选择C选项。

相关考题:

有以下程序:includeint f(int x){int y;if(x==0||x==1)return(3);y=x*x-f(x-2);return 有以下程序: #include<stdio.h> int f(int x) {int y; if(x==0||x==1)return(3); y=x*x-f(x-2); return y; } main() {int z; z=f(3);printf("%d\n",z); } 程序的运行结果是( )。A.0B.9C.6D.8

下列程序的输出结果是()。 include VOid p(int *x) {printf("%d",++*x); } void main() 下列程序的输出结果是( )。#include<stdio.h>VOid p(int *x){ printf("%d",++*x);}void main(){ int y=3;p(y);}A.3B.4C.2D.5

以下程序段的运行结果是( )。 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"); } }

以下程序的输出结果是( )。 include void fun(int x) {if(x/2>0)fun(x/2); printf("%d", 以下程序的输出结果是( )。include<stdio.h>void fun(int x){ if(x/2>0)fun(x/2);printf("%d",x);}main(){fun(3);printf("\n");}

有以下程序:include main(){ inta=1,b=2,c=3,x; x=(ab)c; printf("%d\n",x);}程 有以下程序: #include <stdio.h> main() { int a=1,b=2,c=3,x; x=(ab)c; printf("%d\n",x); } 程序的运行结果是( )。A.0B.1C.2D.3

有以下程序 include define F(X,Y) (X)*(Y) main( ) { int a=3, b=4; prin 有以下程序#include <stdio.h>#define F(X,Y) (X)*(Y)main( ){ int a=3, b=4;printf("%d\n", F(a++, b++));}程序运行后的输出结果是A.12B.15C.16D.20

有以下程序:include main() {int a[] = {2,4,6,8,10} ,y =0,x, * p;p =a[1];for( 有以下程序: #include <stdio.h> main() { int a[] = {2,4,6,8,10} ,y =0,x, * p; p =a[1]; for(x=1;x<3;x++)y+ =p[x]; printf( "% d \n" , y); }程序运行后的输出结果是( )。A.10B.11C.14D.15

有以下程序:include void f(int v, int w){int t; t=v; v=w; w=t;}main(){int x=1,y=3 有以下程序: #include <stdio.h> void f(int v, int w) { int t; t=v; v=w; w=t; } main() { int x=1,y=3,z=2; if(x>y) f(x,y); else if(y>z) f(y,z); else f(x,z); printf("%d,%d,%d\n",x,y,z); } 执行后的输出结果( )。A.1,2,3B.3,1,2C.1,3,2D.2,3,1

有以下程序:include int fun(int n){if(n == 1) return 1;else return( n + fun( n - 有以下程序:#include <stdio.h>int fun(int n){ if(n == 1) return 1; else return( n + fun( n - 1 ) );}main( ){ int x; seanf("% d" ,X) ;x = fun(x) ;pfinff( "% d \n" ,x);} 执行程序时,给变量x输入10,程序的输出结果是( )。A.55B.54C.65D.45

下列程序的输出结果是()。 include int fun(int x) {int a; if(x==0‖x==1) return 3; 下列程序的输出结果是( )。#include<stdio.h>int fun(int x){ int a;if(x==0‖x==1)return 3;elsea=x-fun(x-2) ;return a;}void main(){ printf("%d",fun(7) );}A.2B.8C.9D.5

有以下程序 include main() { int a=1, b=2, c=3, x; x=(a^b)c; pri 有以下程序 #include <stdio.h> main() { int a=1, b=2, c=3, x; x=(a^b)c; printf("%d\n",x); } 程序的运行结果是A.0B.1C.2D.3

下列程序的输出结果是()。 include int fun(int x) {int a;if(x==0‖x==1) return 3;els 下列程序的输出结果是( )。 #include<stdio.h> int fun(int x) { int a; if(x==0‖x==1) return 3; else a=x-fun(x-2); return a; } void main() { printf("%d",fun(7)); }A.2B.8C.9D.5

有以下程序include main(){int x; scanf("%d",x); if(x 有以下程序 #include <stdio.h> main() { int x; scanf("%d",x); if(x<=3); else if(x!=1O) printf("%d\n",x); } 程序运行时,输入的值在______范围才会有输出结果。A.不等于10的整数B.大于3且不等10的整数C.大于3或等于10的整数D.小于3的整数

有以下程序includeint fun(int x;int y){if(x=y)reurn(x); elsereturn((x+y)/2);}main 有以下程序 #include<stdio.h> int fun(int x;int y) { if(x=y)reurn(x); else return((x+y)/2); } main() { int a=4,b=5,c=6; printf("%d\n",fun(2*a,fun(b,c))); } 程序运行后的输出结果是______。A.3B.6C.8D.12

有以下程序includeintf(intx){inty;if(x==0||x==1)return(3);y=x*x-f(x-2);returny;}m 有以下程序 #include <stdio.h> intf(int x) { int y; if(x==0||x==1) return(3); y=x*x-f(x-2); return y; } main() { int z; z=f(3); printf("%d\n",z); } 程序的运行结果是A.0B.9C.6D.8

有以下程序:includedefine X 5+6main(){int a=2,c;C=X*2:printf("%d",C);}程序运行后 有以下程序: #include<stdio.h> #define X 5+6 main() {int a=2,c; C=X*2: printf("%d",C); } 程序运行后的输出结果是( )。A.17B.22C.16D.11

有以下程序 include mare() { int x=1,y=2,z=3; if(x>y) if 有以下程序 #include <stdio.h> mare() { int x=1,y=2,z=3; if(x>y) if(y<z) printf("%d",++z); else printf("%d",++y); printf("%d\n",x++); } 程序的运行结果是______。A.331B.41C.2D.1

有以下程序 include struct st { int x,y;} data[2]={1,10,2,20}; main( 有以下程序 #include <stdio.h> struct st { int x,y;} data[2]={1,10,2,20}; main() { struct st *p=data; printf("%d,",p->y); printf("%d\n",(++p)->x); } 程序的运行结果是______。A.10,1B.20,1C.10,2D.20,2

有下列程序: include int f(int x) { int y; if(x=0‖x==1)r 有下列程序: #include <stdio.h> int f(int x) { int y; if(x=0‖x==1)return(3); y=x*x-f(x-2); return y; } main() { int z; z=f(3);printf("%d\n",z); 程序的运行结果是( )。A.0B.9C.6D.8

有以下程序:includeint fun(int x,int y){if(x==y)return(x);else return((x+y)/2);}m 有以下程序: #include<stdio.h> int fun(int x,int y) {if(x==y)return(x); else return((x+y)/2); } main() {int a=1,b=2,c=3; printf("%d\n",fun(2*a,fun(b,C))); } 程序运行后的输出结果是( )。A.2B.3C.4D.5

有以下程序: include using namespace std; int main() {int x;for(int i=1;i 有以下程序: #include <iostream> using namespace std; int main() { int x; for(int i=1;i<=100;i++) { x=i; if (++x%2==0) if (++x%3==0) if (++x%7==0) cout<A.39,81B.42,84C.26,68D.28,70

有以下程序:includemain(){int x=3,y=2,z=1; printf("%d\n",x/y~z);程序运行后的 有以下程序: #include <stdio.h> main() { int x=3,y=2,z=1; printf("%d\n",x/y~z); 程序运行后的输出结果是( )。A.3B.2C.1D.0

有以下程序:includedefine N 8void fun(int*x,int i){*x=*(x+i)+1;}main(){int a[N]= 有以下程序: #include<stdio.h> #define N 8 void fun(int*x,int i) {*x=*(x+i)+1;} main() {int a[N]={1,2,3,4,5,6,7,8},i; fun(a,2); for(i=0;i<N/2;i++) {printf("%d",a[i]);} printf("\n"); } 程序运行后的输出结果是( )。A.1 3 1 3B.3 2 3 4C.4 2 3 4D.1 2 3 4

有以下程序includeint f(intx){inty; if(x==0||x==1)return(3); y=x*x-f(x-2); return 有以下程序 #include <stdio.h> int f(int x) { int y; if(x==0||x==1) return(3); y=x*x-f(x-2); return y; } main() { int z; z=f(3); printf("%d\n",z); } 程序的运行结果是A.0B.9C.6D.8

下面的程序段中,有()处错误和警告。includeint main()int x; cin>>x cout 下面的程序段中,有( )处错误和警告。 #include<stdio.h> int main() int x; cin>>x cout<<x; }A.1B.2C.3D.4

下列程序的输出结果是( )。 include int fun(int x) {int p;if(x==0‖x==1) return 3;el 下列程序的输出结果是( )。 #include<stdio.h> int fun(int x) { int p; if(x==0‖x==1) return 3; else p=x-fun(x-2); return p; } void main() { print f("\n%d", fun(5)); }A.5B.3C.7D.1

有以下程序:includefun(int x,int y,int z){z=x*y;}main(){int a=4,b=2,c=6; fun(a,b, 有以下程序: #include <stdio.h> fun(int x,int y,int z) { z=x*y;} main() { int a=4,b=2,c=6; fun(a,b,c); printf("%d",c); } 程序运行后的输出结果是( )。A.16B.6C.8D.12

有以下程序:include define F(X,Y)(X)*(Y)main(){int a=3,b=4;printf("%d\n",F(a++,b 有以下程序: #include <stdio.h> #define F(X,Y)(X)*(Y) main() { int a=3,b=4; printf("%d\n",F(a++,b++)); } 程序运行后的输出结果是( )。A.12B.15C.16D.20