SWAP FUNCION
//use header files syntax according to the compiler
#include<iostream.h>
#include<conio.h>
#include<conio.h>
void swap(int c, int d)
{
int temp;
temp=c;
c=d;
d=temp;
cout<<" after swapping ";
cout<<"c:"<<c<<" d:"<<d;
}
Main Programme
void main()
{
int a,b;
cout<<"enter 2 numbers:";
cin>>a>>b;
cout<<"a:"<<a<<" b:"<<b;
swap(a,b);
getch();
}