写出下列程序的输出结果( )。#include <stdio.h>void fun1( ){ int x=5; printf("x=%d\n",x);}void fun2(int x){ printf("x=%d\n", ++x);}void main( ){ int x=2; fun1( ); fun2(x); printf("x=%d\n", x);}
举一反三
- 阅读程序,写结果:#include <stdio.h>int fun1(int x);void fun2(int x);void main(){int x=1;x=fun1(x);printf("%d\n",x);}int fun1(int x){x++;fun2(x);return x;}void fun2(int x){x++;}
- 以下程序的输出结果是 ( ) 。# include <;stdio.h>;void fun(int x){if(x/2>;0)fun(x/2);printf("%d",x);}main(){fun(3);printf("\n");}
- 以下程序的输出结果是( )。 #include void fun(int *p); int main() { int x = 3; fun(&x); printf(“x = %d\n”, x); } void fun(int *p) { *p = 5; }
- 下列程序的运行结果是( )#include <stdio.h>int fun1(int x); void fun2(); int x=5; int main() { int x=1; x=fun1(x); printf("%d",x); return 0; } int fun1(int x) { x++; fun2(); return x; } void fun2() { x++;} A: 6 B: 5 C: 2 D: 7
- 下列程序的运行结果是( ) #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