//  File: ref3.C
//  
//  using references

#include <stdio.h>

void swap(int &a, int &b) {
   int temp ;
  
   temp = a ;
   a = b ;
   b = temp ;
}

main() {
   int x = 3, y = 17 ;

   printf("Before: x = %d, y = %d\n", x, y) ; 
   swap(x,y) ;
   printf("After: x = %d, y = %d\n", x, y) ; 
}
