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;}
查看答案
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);}运行结果为________。
main(){int a, b;scanf( " % d ", & a );scanf( " % d ", & b );swap( a, b );}swap( int a, int b ){int t;t = a; a = b; b= t;printf( " a = % d,b= % d\ n ", a, b );}运行时输入100,200,运行结果为________。