有下列程序: #include <stdio.h> main() {int a[]={1,2,3,4},y,*p=&a[3]; --p; y=*p; printf("y=%d\n",y); } 程序的运行结果是( )。
A.y=0
B.y=1
C.y=2
D.y=3
第1题:
有以下程序: #include<stdio.h> main() {inta[]={1,2,3,4},y,*p=&a[3]; --p;y=*p;printf("y=%d\n",y); } 程序的运行结果是( )。
A.y=0
B.y=1
C.y=2
D.y=3
第2题:
有以下程序 #include <stdio.h> main() { int a[]={1,2,3,4},y,*p=&a[3]; --p; y=*p;printf("y=%d\n",y); } 程序的运行结果是
A.y=0
B.y=1
C.y=2
D.y=3
第3题:
以下程序的输出结果是( )。 include<stdio.h> void swap(int*a,int*B){int*t; t=a;a=b;b=c;} main() {int i=3,j=5,*p=&i,*q=&j; swap(p,q);printf("%d %d\n",*p,*q); }
第4题:
有以下程序: #include<stdio.h> main() { int a[]={1,2,3,4},y,*p=&a[3]; --p;y=*p;printf("y=%d\n",y); } 程序的运行结果是( )。
A.y=0
B.y=1
C.y=2
D.y=3
第5题:
有以下程序:#include <stdio.h>void f(int * x,int * y) int t; t= *x; *x= *y; *y=t;main ( ){ int a[8] = { 1,2,3,4,5,6,7,8} ,i, * p, * q; p=a;q =&a[7]; while(p<q) { f(p,q) ;p ++ ;q --; } for(i =0;i<8;i ++ ) printf(" % d," ,a[i]); }程序运行后的输出结果是( )。
A.8,2,3,4.,5,6,7,1,
B.5,6,7,8,1,2,3,4,
C.1,2,3,4,5,6,7,8,
D.8,7,6,5,4,3,2,1,