分析以下四个程序中,哪一个不能对两个整型变量的值进行交换。
A.
B. include<stdlib.h>void swap(int *p,int *q);{ int *t; t=p;p=q;q=t;}int main(){ int a=10,b=20; swap(&a,&b); printf("%d %d\n",a,
C. ;return 0;} B、
D. include<stdlib.h>void swap(int *p,int *q);{ int t; t=*p;*p=*q;*q=t;}int main(){ int a=10,b=20; swap(&a,&b); printf("%d %d\n",a,b);return 0;}
E. C.
F. include<stdlib.h> void swap(int *p,int *q){ int t; t=*p;*p=*q;*q=t;}int main(){ int x,y,*a=&x,*b=&y; *a=10,*b=20; swap(a,b); printf("%d %d\n",*a,*b); return 0;}
G. D.
H. include<stdlib.h>void swap(int *p,int *q);{ int t; t=*p;*p=*q;*q=t;}int main(){ int a=10,b=20; int *x=&a,*y=&b; swap(x,y); printf("%d %d\n",a,b); return 0;}