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