有以下程序#include void fun( int *s, int t, int *k ){ int p;for( p=0, *k=p; ps[*k] ) *k = p;}main(){int a[10] = { 11,12,13,14,15,16,20,18,19,10 },k ;fun( a,10,&k );printf( "%d,%d\n",k, a[k] );}程序运行后的输出结果是
A. 6,20
B. 10,9
C. 7,20
D. 10,10
查看答案
有以下程序#include main(){char *s[6] = { "ABCD", "EFGH","IJKL","MNOP","QRST","UVWX" }, **p ;int i;p = s;for( i = 0; i<4; i++ ) printf( "%s", p[i] );printf( "\n" );}程序运行后的输出结果是
ABCDEFGHIJKLMNOP
B. ABCDEFGHIJKL
C. ABCD
D. AEIM
以下选项中,不能对主函数中变量i和j的值进行交换的程序是
A.
B. include void swap( int *p,int *q){ int *t; *t=*p; *p=*q; *q=*t;}main(){ int i=10,j=20, *a=&i, *b=&j; swap(a,b); printf("i=%d j= %d\n", i,j );}
C. B.
D. include void swap( int *p,int *q){ int t; t=*p; *p=*q; *q=t;}main(){ int i=10,j=20, *a=&i, *b=&j; swap(a,b); printf("i=%d j= %d\n", i,j );}
E. C.
F. include
G. include void swap( int *p,int *q){ int *t; t=(int *)malloc(sizeof(int)); *t=*p; *p=*q; *q=*t; free(t);}main(){ int i=10,j=20; swap(&i,&j); printf("i=%d j= %d\n", i,j );}
H. D.
I. include void swap( int *p,int *q){ int t; t=*p; *p=*q; *q=t;}main(){ int i=10,j=20 , *x=&i, *y=&j; swap(x,y); printf("i=%d j= %d\n", i,j );}
有以下程序#include main(){int a[10] = { 1,3,5,7,11,13,17 }, *p=a;printf("%d,", *( p++ ));printf("%d\n", *( ++p ));}程序运行后的输出结果是
A. 1,5
B. 3,5
C. 3,7
D. 1,3
有以下程序#include main(){int *p, x=100;p=&x; x=*p+10;printf("%d\n", x);}程序运行后的输出结果是
A. 110
B. 120
C. 100
D. 90