SWAP using Call by Reference Method
#include<stdio.h>
#include<conio.h>
void swap( int *x, int *y ) // call by refrence
{
int t ;
t = *x ;
*x = *y ;
*y = t ;
}
void main( )
{
int a,b;
printf("Enter a, b:");
scanf("%d%d",&a,&b);
printf("\n Before swap a:%d, b:%d",a,b);
swap ( &a, &b ) ; // passing the address of values to be swapped
printf("\n After swap a:%d, b:%d",a,b);
getch();
}