有以下程序#include void func(int n){Static int num=1;num=num+n;printf("%d",num);}main( ){func(3);func(4);printf("\n");}程序运行后的输出结果是()
查看答案
有以下程序:#includeint fun( ){static int x=1;x*=2;return x;}main( ){int i,s=1;for(i=1;i<=2;i++)s=fun( );printf("%d\n",s);}
A. 0
B. 1
C. 4
D. 8
有以下程序#include inta=1,b=2;voidfun1(int a,int b){printf("%d%d",a,b);}voidfun2( ){a=3;b=4;}voidmain( ){fun1(5,6);fun2( );printf("%d %d\n",a,b);}程序运行后的输出结果是()
A. 1 2 5 6
B. 5 6 3 4
C. 5 6 1 2
D. 3 4 5 6
有以下程序#include int fun(int x,int y){ if(x==y) return (x);else return((x+y)/2);}main( ){ int a=4,b=5,c=6;printf("%d\n",fun(2*a,fun(b,c)));}程序运行后的输出结果是()
A. 3
B. 6
C. 8
D. 12
有以下程序#include int fun(int n){if(n)return fun(n-1)+n;elsereturn 0;}void main( ){ printf("%d\n",fun(3));}程序的运行结果是()
A. 4
B. 5
C. 6
D. 7