#include<stdio.h>
#include<stdlib.h>
void exchang(int *m,int *n){
int temp;
temp=*m;
*m=*n;
*n=temp;
}
int main(){
int a,b;
printf("Enter two integer:");
scanf("%d %d",&a,&b);
printf("a:%d b:%d\n",a,b);
exchang(&a,&b);
printf("a:%d b:%d\n",a,b);
system("pause");
return 0;
}
沒有留言:
張貼留言