#include <iostream>
using namespace std;
void fun(int a,int b)
{
int temp=a;
a=b;
b=temp;
cout << "a = " << a << " b = " << b << endl ;
}
void fun(char a,char b)
{
char temp=a;
a=b;
b=temp;
cout << "a = " << a << " b = " << b << endl ;
}
void fun(double a, double b)
{
double temp=a;
a=b;
b=temp;
cout << "a = " << a << " b = " << b << endl ;
}
void fun(string a,string b)
{
string temp=a;
a=b;
b=temp;
cout << "a = " << a << " b = " << b << endl ;
}
int main()
{
fun(1,2);
fun('a','b');
fun(1.2,1.5);
fun("hello","world");
return 0;
}
#include <iostream>
using namespace std;
void fun(int a,int b)
{
int temp=a;
a=b;
b=temp;
cout << "a = " << a << " b = " << b << endl ;
}
void fun(char a,char b)
{
char temp=a;
a=b;
b=temp;
cout << "a = " << a << " b = " << b << endl ;
}
void fun(double a, double b)
{
double temp=a;
a=b;
b=temp;
cout << "a = " << a << " b = " << b << endl ;
}
void fun(string a,string b)
{
string temp=a;
a=b;
b=temp;
cout << "a = " << a << " b = " << b << endl ;
}
void fun(bool a,bool b)
{
bool temp=a;
a=b;
b=temp;
cout << "a = " << a << " b = " << b << endl ;
}
int main()
{
fun(1,2);
fun('a','b');
fun(1.2,1.5);
fun("hello","world");
fun(true,false);
return 0;
}