2. # include “stdio.h”main(){ int i=0,sum=1;do{sum+=i++;}while(i<5);printf(“%d\n”,sum);}结果:
查看答案
3. #include “stdio.h”main(){ int i;for(i=1;i<=5;i++){if(i%2) printf(“*”);else continue;printf(“#”);}printf(“$\n”);}结果:
4. #include “stdio.h”void main(){int a[]={0,9,8,7,6,5,4,3,2,1},*p=a;printf("%d,%d\n",*p+9,*(p+9));}结果:
5. #include “stdio.h”func(int a){static int m=0;m+=a;printf("%d\n",m);}void main(){int k=4;func(k);func(k);}结果:
6. #include "stdio.h"void fun(int b[ ]){int j;for(j=0;j<4;j++)b[j]=2*j;}main(){int a[ ]={5,6,7,8},i;fun(a);for(i=0;i<4;i++)printf("%d",a[i]);}结果: