读程序,写出程序执行结果

1.
读程序,写出程序执行结果
#include <stdio.h>
void ex( )
{ static int x=5 ;
--x ;
printf(“%d”,x) ;
}
void main ( )
{ ex( );
ex( );
ex( );
}

2.
读程序,写出程序执行结果
#include <stdio.h>
#define MAX(a,b) (a>b ? a : b)+1
void main()
{ int i=6,j=8;
printf(“%d\n”,MAX(i,j));
}

3.
读程序,写出程序执行结果
#include <stdio.h>
void main()
{ int k=4,n=0;
for( ; n<k ; )
{ n++;
if(n%3!=0) continue;
k- -;
}
printf("%d,%d\n",k,n);
}

4.
读程序,写出程序执行结果
#include <stdio.h>
void main()
{ int x[]={1,2,3};
int s=1,i,*p=x;
for(i=0;i<3;i++)
s*=*(p+i);
printf(“%d\n”,s);
}

5.
读程序,写出程序执行结果
#include <stdio.h>
#include <string.h>
void main()
{ char a[10]="abc";
char b[]="defg";
puts(a);
puts(b);
puts(strcat(a,b));
}

6.
读程序,写出程序执行结果
#include <stdio.h>
void main()
{ int aa[4][4]={{1,2,3,4},{5,6,7,8},{3,9,10,2},{4,2,9,6}};
int i,s=0 ;
for(i=0;i<4;i++) s+=aa[i][2];
printf(“%d\n”,s);
}

7. 读程序,写出程序执行结果

#include <stdio.h>
void fun(char *w, int n)
{ char t, *s1, *s2;
s1=w;
s2=w+n-1;
while(s1<s2) {t=*s1;*s1= *s2 ; *s2= t; s1++;s2--;}
}
void main()
{ char p[]="1234567";
fun(p, strlen(p));
puts(p);
}

8.
读程序,写出程序执行结果

#include <stdio.h>
void main()
{ int s,i;
for(s=0,i=1;i<5;i++,s+=i) ;
printf(“%d\n”,s);
}

9. 读程序,写出程序执行结果

#include <stdio.h>
int d=1;
fun(int p)
{ int d=5;
d+=p++;
printf(“%d”,d);
}
void main()
{ int a=3;
fun(a); d+=a++;
printf("%d\n", d);
}

10.
读程序,写出程序执行结果
#include <stdio.h>
void main()
{ int n=2;
printf(“%d,%d,%d\n”, ++n , n+=2 , --n) ;
}

第一题4,3,2
第二题。。。。
太多了没得耐心看了追问

大神 求解答啊 帮帮忙吧 谢谢啊

追答

在编译器里面运行一次就都出来了。读真的费劲啊!

追问

不会使用啊 我不是学C语言的

温馨提示:答案为网友推荐,仅供参考

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网