正在加载图片...
printf("%c"*--p i int x,y, z printf("%d, %d, "x,y); printf(%od, %dn",y, z) 五、填空题(每空2分,共20分) 1.以下程序不借助任何变量把a、b中的值进行交换。请填空。 #include<stdio h> i int a, b printf(“ input a, b”) scanf(“%d%d”,&a&b) )b=a( printf( a=%od b=%d n", a,b) 2有以下定义和语句,则 Sizeof(a)的值是( ),而 I sizeof( a share)的 值是( struct date int day int mouth Int union int share 1 float share ishare 3.函数fun的功能是:使一个字符串按逆序存放。请填空。 void fun( char strD i char m; int ij for( F0,strlen(str); K<( )i++j-) r[]; strF( s-1]=m;} printf(“%sin”,str) 4.设ik均为nt型变量,则执行完下面的for循环后,k的值是( k=i+ J 5.条件“20<X<30或x<-100的C语言表达式是( 6.以下程序的输出结果是( #define MAX(x,y)(xP(y)? (x): (y) mainO {inta=5,b=2,c=3,d=3,t; t=MAX(a+b, c+d)*10printf("%c ",*--p); } 5、main() { int x,y,z; x=y=z=3; y=x++-1; printf("%d,%d,",x,y); y=z--+1; printf("%d,%d\n", y,z); } 五、填空题(每空 2 分,共 20 分) 1.以下程序不借助任何变量把a、b中的值进行交换。请填空。 #include<stdio.h> main() { int a,b; printf(“input a,b”); scanf(“%d%d”,&a,&b); a+=( );b=a-( );a-=( ); printf(“a=%d b=%d\n”,a,b); } 2.有以下定义和语句,则sizeof(a)的值是( ),而sizeof(a.share)的 值是( )。 struct date { int day; int mouth; int year; union { int share1; float share2; }share; }a; 3. 函数fun的功能是:使一个字符串按逆序存放。请填空。 void fun(char str[]) { char m; int i,j; for( i=0,j=strlen(str);i<( );i++,j--) { m=str[i]; str[i]=( ); str[j-1]=m;} printf(“%s\n”,str); } 4.设i,j,k均为int型变量,则执行完下面的for循环后,k的值是( ) for(i=0,j=10;i<=j;i++,j--) k=i+j; 5.条件“20<x<30或x<-100“的C语言表达式是( )。 6.以下程序的输出结果是( )。 #define MAX(x,y) (x)>(y)?(x):(y) main() { int a=5,b=2,c=3,d=3,t; t=MAX(a+b,c+d)*10;
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有