执行下列程序 int fun(int x1,int x2){ int x; x1>x2 (x=3):(x=4); return x+x1; } void main(){ cout<<fun(7,8); } 后输出结果是 ______。
A: 9
B: 10
C: 11
D: 12
A: 9
B: 10
C: 11
D: 12
举一反三
- 下列程序段的输出结果是 include void fun(int * X,int * y) {cout < < * X < < 下列程序段的输出结果是 #include<iostream.h> void fun(int * X,int * y) { cout < < * X < < * y; * X=3; * y=4; } void main( ) { int x=1,y=2; fun(&y,&x); cout < < X < < y < < end1; } A.2143 B.1212 C.1234 D.2112
- 下列程序的运行结果是( ) #include void fun(int x); int main() { fun(7); printf(""); return 0; } void fun(int x) { if(x/2>1) fun(x/2); printf("%2d",x); } A: 3 5 B: 2 7 C: 3 7 D: 2 5
- 有下列程序,程序运行后的输出结果是( )。 #include void fun( int *x,int *y); int main() { int x=1,y=2; fun(&y,&x); printf("%d %d",x,y); return 0; } void fun( int *x,int *y) { printf("%d%d",*x,*y); *x=3;*y=4; }
- #include <;stdio.h>;int fun(int x);int main(){ printf("%d",fun(4)); return 0;}int fun(int x){ if(x==1)return 3; return x*x+fun(x-1);}程序输出结果为( )
- 【9.4】下列程序段的输出结果是。 void fun(int *x, int *y) {printf("%d%d",*x,*y); *x=3; *y=4;} main() {int x=1,y=2; fun(&y, &x); printf("%d%d",x,y); }