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

#include <iostream.h>

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

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

   cout << "Before: x = " << x << ", y = " << y << "\n" ;
   swap(x,y) ;
   cout << "After: x = " << x << ", y = " << y << "\n" ; 
}
