//Program to swap two number using call by reference

| |


#include<iostream.h>
#include<conio.h>
 int main()
 {
 clrscr();
 int a,b;
 void swap(int&,int&);
 cout<<"Enter a:";
 cin>>a;
 cout<<"\nEnter b:";
 cin>>b;
 swap(a,b);
 cout<<"\n using call by reference"<<endl;
 cout<<"\n after swaping:"<<"\na:"<<a<<"\nb:"<<b;
 getch();
 }
 void swap(int&x,int&y)
 {
 int z;
 z=x;
 x=y;
 y=z;
 }
<