4.下列程序的执行结果是()。#includeint a=100;int main(){int a=200;{int a=300;}printf("%d\n",a);return 0;}
A. 0
B. 100
C. 200
D. 300
查看答案
7.下列程序的运行结果是()。#includeintfmy(intx){staticinta=3;a+=x;returna;}intmain(){intk=2,m=1,n;n=fmy(k);n=fmy(m);printf("%d\n",n);return0;}
A. 3
B. 4
C. 6
D. 9
6.下列程序的运行结果是()。#includeinta=3,fun();intmain(){inta=1,b;{inta=2;b=fun();printf("%d,",a);}printf("%d,",a);printf("%d\n",b);return0;}intfun(){returna+2;}
A. 1,2,5
B. 1,2,4
C. 2,1,4
D. 2,1,5
仔细阅读如下程序,写出运行结果main(){extern int x,y;printf("%d",func(x,y)); }int x=15,y=-5;func( int a,int b){int s;s=a+b;return(s);}运行结果为________。