#include <iostream>
using namespace std;
template<class T>
void swap(T *a,T *b)
{
T t;
t=*a;
*a=*b;
*b=t;
}
int main()
{
int x=10,y=20;
cout<<"Before swapping :"<<x <<y;
swap(&x,&y);
cout<<"\nAfter swapping :"<<x <<y;
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: