#liclude <stdio.h>
int swap(int *a,int *b);
void main()
{
int x=7, y=11;
printf("before swapped: ");
printf("x=%d,y=%d\n",x,y);
y=swap(&x,&y);
printf("after swapped: ");
printf("x=%d,y=%d\n",x,y);
}
int swap(int *a,int *b)
{
int t;
t=*a;
*a=*b;
return t;
}
int swap(int *a,int *b);
void main()
{
int x=7, y=11;
printf("before swapped: ");
printf("x=%d,y=%d\n",x,y);
y=swap(&x,&y);
printf("after swapped: ");
printf("x=%d,y=%d\n",x,y);
}
int swap(int *a,int *b)
{
int t;
t=*a;
*a=*b;
return t;
}