#include <stdio.h>
void swap(int *x,int *y);
void main()
{
int n1=10,n2=20;
swap(&n1,&n2); /* address of n1 and n2 is passed to swap function */
printf("Number1 = %d\n",n1);
printf("Number2 = %d",n2);
}
void swap(int *x,int *y) /* pointer x and y points to address of n1 and n2 respectively */
{
int t;
t = *x;
*x = *y;
*y = t;
}