#include<iostream.h>
#include<conio.h>
template <class T>
void swap(T x,T y)
{
T temp=x;
x=y;
y=temp;
}
void fun(int m,int n,float a,float b)
{
cout<<"Value of m & n before swap is:
"<<m<<"\t"<<n;
swap(m,n);
cout<<"\n Value of m & n agter swap
is: "<<m"\t"<<n;
cout<<"\n Value of a & b before swap
is: "<<a<<"\t"<<b;
swap(a,b);
cout<<"\n Value of a & b after swap:
"<<a<<"\t"<<b;
}
int main()
{
clrscr();
fun(100,200,12.4,13.4);
return 0;
}
Output